I have uploaded images to a folder named uploads on my server. I would like to access the images through a url e.g. http://localhost:3000/uploads/image.jpg. I have tried to configure it to work two different ways but have been unsuccessful.
ServeStaticModule.forRoot({
rootPath: join(__dirname, '..', 'uploads')
})
app.useStaticAssets(join(__dirname, '..', '/uploads'), {
index: false,
prefix: 'uploads'
});
Is there something I may be missing?