DEV Community

Discussion on: A crash course on serverless-side rendering with React.js, Next.js and AWS Lambda

Collapse
 
joshglazer profile image
Josh Glazer

Is it possible to display images from the static folder once the site is deployed? I added an image for a logo to the static folder and am displaying it in the header component. It shows while I'm developing on localhost, but when I deploy to AWS it shows as a broken image.

Here's my code:
github.com/joshglazer/freetimeupda...

Collapse
 
joshglazer profile image
Josh Glazer

I figured this out myself. In case anyone's curious, you can fix this by adding the following line of code to your server.js file.

server.use('/static', express.static('static'))