<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Chidozie Jona-paschal Inya on Medium]]></title>
        <description><![CDATA[Stories by Chidozie Jona-paschal Inya on Medium]]></description>
        <link>https://medium.com/@jonapaschalinya?source=rss-6f4fa7403b58------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*-CJI6GcEcC5QH1zN</url>
            <title>Stories by Chidozie Jona-paschal Inya on Medium</title>
            <link>https://medium.com/@jonapaschalinya?source=rss-6f4fa7403b58------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 08:37:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jonapaschalinya/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building a Blog-Api using Node.Js with Express.]]></title>
            <link>https://medium.com/@jonapaschalinya/building-a-blog-api-using-node-js-with-express-681c1fb3c3de?source=rss-6f4fa7403b58------2</link>
            <guid isPermaLink="false">https://medium.com/p/681c1fb3c3de</guid>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[node]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[expressjs]]></category>
            <dc:creator><![CDATA[Chidozie Jona-paschal Inya]]></dc:creator>
            <pubDate>Tue, 10 Jan 2023 23:27:52 GMT</pubDate>
            <atom:updated>2023-01-10T23:27:52.923Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>This document is a technical description of a blog API written with NodeJS and Express. Node.js is an open-source, cross-platform JavaScript runtime environment. Express is a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications. This API allows users to create, read, update and delete blog posts.</p><h3>Requirements</h3><ul><li>Users should have a first_name, last_name, email, password</li><li>A user should be able to sign up and sign in into the blog app</li><li>Use JWT as authentication strategy and expire the token after 1 hour</li><li>A blog can be in two states; draft and published</li><li>Logged in and not logged in users should be able to get a list of published blogs created</li><li>Logged in and not logged in users should be able to to get a published blog</li><li>Logged in users should be able to create a blog.</li><li>When a blog is created, it is in draft state</li><li>The owner of the blog should be able to update the state of the blog to published</li><li>The owner of a blog should be able to edit the blog in draft or published state</li><li>The owner of the blog should be able to delete the blog in draft or published state</li><li>The owner of the blog should be able to get a list of their blogs.</li><li>The endpoints should be paginated</li><li>It should be filterable by state</li><li>Blogs created should have title, description, tags, author, timestamp, state, read_count, reading_time and body.</li><li>The list of blogs endpoint that can be accessed by both logged in and not logged in users should be paginated:</li><li>default it to 20 blogs per page.</li><li>It should also be searchable by author, title and tags.</li><li>It should also be orderable by read_count, reading_time and timestamp</li><li>When a single blog is requested, the api should return the user information (the author) with the blog. The read_count of the blog too should be updated by 1</li><li>Come up with any algorithm for calculating the reading_time of the blog.</li></ul><p>And lastly,</p><ul><li>Write tests for all endpoints</li></ul><h3>Development prerequisites</h3><p>The following prerequisites will be necessary to use the blog API:</p><ul><li>Node.js</li><li>ExpressJS</li><li>MongoDB</li></ul><h3>Installation</h3><ol><li>Install Node.js and MongoDB.</li><li>Install the necessary packages for the project.</li><li>Create the model for the blog post.</li><li>Create the routes for the API.</li></ol><h3>Usage</h3><p>Once the API is set up, the following endpoints can be used to create, read, update and delete blog posts:</p><ol><li>Creating a user:</li></ol><ul><li>Route: /api/signup</li><li>Method: POST</li></ul><p>2. Logging in</p><ul><li>Route: /api/login</li><li>Method: POST</li></ul><p>3. Create a Blog</p><ul><li>Route: /api/blog</li><li>Method: POST</li><li>Header</li><li>Authorization: Bearer {token}</li></ul><p>4. Get all published blogs</p><ul><li>Route: /api/blog</li><li>Method: GET</li><li>Header</li><li>Authorization: Bearer {token}</li><li>None (Accessible to unauthenticated users)</li></ul><p>5. Update the contents of a Blog</p><ul><li>Route: /api/blog/:articleId</li><li>Method: PUT</li><li>Header</li><li>Authorization: Bearer {token}</li></ul><p>6. Delete a Blog</p><ul><li>Route: /api/blog/:articleId</li><li>Method: DELETE</li><li>Header</li><li>Authorization: Bearer {token}</li></ul><h3>Conclusion</h3><p>This document provides a technical description of the blog API written in Node.Js with Express. It outlines the requirements of the API and provides instructions for installation and usage.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=681c1fb3c3de" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>