So I'm trying to create a content feed using data fetched from my Node JS server.
Here I fetch data from my API
class Webservice {
    func getAllPosts(completion: @escaping ([Post]) -> ()) {
        guard let url = URL(string: "http://localhost:8000/albums")
     else {
     fatalError("URL is not correct!")
    }
        URLSession.shared.dataTask(with: url) { data, _, _ in
            let posts = try!
                JSONDecoder().decode([Post].self, from: data!); DispatchQueue.main.async {
                    completion(posts)
            }
        }.resume()
    }
}
Set the variables to the data fetched from the API
final class PostListViewModel: ObservableObject {
    init() {
        fetchPosts()
    }
    @Published var posts = [Post]()
    private func fetchPosts() {
        Webservice().getAllPosts {
            self.posts = $0
        }
    }
}
struct Post: Codable, Hashable, Identifiable {
    let id: String
    let title: String
    let path: String
    let description: String
}
SwiftUI
struct ContentView: View {
    @ObservedObject var model = PostListViewModel()
        var body: some View {
            List(model.posts) { post in
                HStack {
                Text(post.title)
                Image("http://localhost:8000/" + post.path)
                Text(post.description)
                }
            }
        }
}
The Text from post.title and post.description are display correctly but nothing displays from Image(). How can I use a URL from my server to display with my image?
 
     
     
     
     
     
     
     
     
     
     
     
    