Book
Submodule 22.2: Setting up a Server using json-server
Submodule 22.2: Setting up a Server using json-server
Completion requirements
View
The public folder
You will now update the json-server to enable it to serve up resources from its public folder.
Go to the jsonServer
folder and create a folder in there and named it public
Download the images.zip file, unzip it and move the images folder to the public folder that you created above
Restart your json-server by typing in the terminal json-server --watch db.json
.
You can access your images by typing in the browser address bar localhost:3000/images/almonds.jpg
f.e.