Answer by Lucas for express static file serve configuration
You can use the static function in another way: app.use('/', express.static('assets')); ...and call the image as the example below: <img src='/images/logo.png'> I hope this helps.
View ArticleAnswer by dezinezync for express static file serve configuration
Please try the following: app.use(‘/assets’, express.static(path.join(__dirname, '..', ‘assets’))); Change the parameters to path.join as per your directory structure.
View ArticleAnswer by atmys for express static file serve configuration
__dirname represents the directory name of the current module. You should use '../assets/images' as a static path for your images. Trying to access localhost:3001/images returns an error because it is...
View Articleexpress static file serve configuration
I'm trying to serve static assets from express server which also happens to have Apollo Server installed on it, but this is an issue related to the express.static configuration. Here's a screenshot of...
View Article
More Pages to Explore .....