O'Reilly logo

JavaScript by Example by Dani Akash S

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding a new blog post

We have successfully built the home page for our blog. The next task is to build the author list page. However, I'll leave the construction of the author list to you. You can refer to the completed code files and build the author list page. This will be a good practice exercise for you.

So, that leaves us with the last page, which is the new post page. The API we are going to use for adding a new blog post is POST /post, which you can see in the swagger document. The body of the post request will be in the following form:

{  "id": "string",  "title": "string",  "content": "string",  "datetime": "string",  "author": "string"}

Here, id is the unique ID for the blog post and datetime is the epoch timestamp as a string. Usually, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required