August 2017
Beginner
298 pages
7h 4m
English
In the starter files, I have included a routes.js file in the src/routes.js path. This file contains all the routes we are going to use on our blog in the form of JSON objects:
const routes = { home: '/home', authors: '/authors', author: '/author/:authorname', newPost: '/new-post', post: '/post/:id',};export default routes;
See the home page of the completed blog app. The URL will be pointing to the '/home' route. Likewise, each page has its respective route. However, some routes have dynamic values. For example, if you click Read More in a blog post, it will take you to the page with the URL:
http://localhost:3000/post/487929f5-47bc-47af-864a-f570d2523f3e
Here, the third part of the URL is the post's ID. To represent such ...
Read now
Unlock full access