YHyusuf habibinproton-code-blog.hashnode.dev·Jan 8, 2023 · 4 min readStep 4: Public Blog Functions, Securities And Rate Limiting.get blog: not logged-in users and logged users can get access to published blogs, this is achieved by creating blog.js file in the route and controller folder. route/blog.js const express = require("express") const { getAllBlogs } = require("../contr...00
YHyusuf habibinproton-code-blog.hashnode.dev·Jan 8, 2023 · 7 min readStep 3: Blog Functioalities For Logged In Userscreate a validation for posts: create a blog.validate.js file in the validator folder in the root directory and update it with the code below to handle blogs created in the database. const Joi = require("joi"); const createPost = Joi.object({ titl...00
YHyusuf habibinproton-code-blog.hashnode.dev·Jan 8, 2023 · 3 min readStep 2: Signup And Loging In Userscreate a user validation file: create a validation folder at the root directory, and create a file user.js for validating user information. const Joi = require("joi"); const UserSignUp = Joi.object({ firstname: Joi.string().max(255).trim().require...00
YHyusuf habibinproton-code-blog.hashnode.dev·Jan 8, 2023 · 4 min readCreate Server Blog API: Steps or GuidesIn this blog post, we are going to be creating an API to handle posting blogs. For this API we will be using nodejs(express). A Blog API is an API by which users can fetch blogs, write blogs to the server, delete blogs, and even filter blogs with var...00