{"id":17207357,"url":"https://github.com/abdus/node-blog-api","last_synced_at":"2026-05-09T16:16:58.109Z","repository":{"id":99638133,"uuid":"152969897","full_name":"abdus/node-blog-api","owner":"abdus","description":"[FAILED] A simple blog API to start your own blog.","archived":false,"fork":false,"pushed_at":"2018-10-15T16:16:51.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-30T10:15:31.630Z","etag":null,"topics":["api","blog","node-blog","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abdus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-14T12:09:51.000Z","updated_at":"2018-12-15T17:17:10.000Z","dependencies_parsed_at":"2023-07-31T08:31:57.787Z","dependency_job_id":null,"html_url":"https://github.com/abdus/node-blog-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdus%2Fnode-blog-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdus%2Fnode-blog-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdus%2Fnode-blog-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdus%2Fnode-blog-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abdus","download_url":"https://codeload.github.com/abdus/node-blog-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245449681,"owners_count":20617190,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","blog","node-blog","nodejs"],"created_at":"2024-10-15T02:45:18.007Z","updated_at":"2025-09-16T16:12:20.180Z","avatar_url":"https://github.com/abdus.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Node Blog API\n\n### Simple API written using NodeJS, Express and MongoDB.\n\n## Table of Content\n- [Introduction](#introduction)\n- [How to Setup Locally](#how-to-Setup-Locally)\n- [API Endpoints](#api-endpoints)\n\n## Introduction\nThis is a blog API built with Node JS and ExpressJS. It uses MongoDB for storing database. As of now, this project doesn't have front-end codes yet. You have to build front-end by yourself with any of the available framework (or with JS, HTML \u0026 CSS), make API call to back-end to fetch blogposts/users and render them in from-end. It uses JSON to transfar data between client and server.\n\n## How to Setup Locally \n1. Fork this Repository(if you want to keep it sync) and clone the fork `git clone \u003cURL\u003e`\n2. Change directory to the project root `cd DIRNAME`\n3. Install npm packages using using `npm install`\n4. Start your development server `node bin/www`\n\n## API Endpoints\nAll API calls need auth, i.e. you need an access token to make a successful API call. To get an access token, you need to register yourself using email and password. You can use mongo shell to create a document under collection `users` or you can use `/signup` endpoint. By default, `/signup` end-point save a new user as _not approved_ account and doesn't have _admin_ access. You can easily set them to `true` through mongo shell. Note that, it `/api` endpoints won't work if this options are set to `false`. Below is a sample fetch request to create a new account. \n\n```js\nfetch('/auth/signup', {\n    method: 'POST',\n    headers: {\n        'Content-Type': 'application/json'\n    },\n    body: JSON.stringify({\n        name: 'YOUR NAME HERE',\n        displayName: 'NICK NAME [OPTIONAL]',\n        Website: 'example.com [OPTIONAL]',\n        email: 'YOU@EMAIL.COM',\n        password: 'YOUR PASS'\n    })\n})\n.then(res =\u003e res.json())\n.then(res =\u003e {\n    // Here you will get your account status\n})\n.catch(err =\u003e console.log(err));\n```\n**NOTE: ALL API REQUEST WANT YOU TO PASS AN ACCESS TOKEN GENERATED BY `/auth/login` TO MAKE A SUCCESSFUL API CALL. YOU CAN INCLUDE A TOKEN IN HEADER UNDER THE NAME `x-access-token`. BELOW IS AN EXAPMLE**\n```js\n...\n\nfetch('/api/blog/posts'{\n    method: 'GET',\n    headers: {\n        'Content-Type': 'application/json',\n        'x-access-token': 'TOKEN HERE'\n    }\n})\n\n...\n```\n## BlogPost EndPoints\n- 01 GET [`/api/blog/posts`](#01-retrieve-all-blog-posts) \n- 02 GET [`/api/blog/find/:id`](#02-retrieve-a-single-post-by-post-id)\n- 03 POST [`/api/blog/new`](#03-insert-a-new-blog-post)\n- 04 PUT [`/api/blog/update/:id`](#04-update-an-existing-post)\n### 01 Retrieve all blog posts\n```\n/api/blog/posts\n```\n\nThis end-point returns all posts store in your database. You can filter the results with a URL query. For example, if you want to find all the posts which aren't saved as a draft, use the the following URL string `/api/blog/posts?draft=false`. You can specify as many conditions you want to be satisfied. For example, `/api/blog/posts?draft=true`\n\n### 02 Retrieve a Single Post by Post ID\n\n```\n/api/blog/find/:id\n```\nGet a post by it's unique ID (`_id`). \n\n### 03 Insert a New Blog-Post\n```\n/api/blog/new\n```\nInsert a new blog post to database. You have to provide all the required fields. \n\n### 04 Update an Existing Post\n```\n/api/blog/update/:id\n```\nYou can update an existing blog post. All you need is the unique id(`_id`) of that post.\n\n## User EndPoints\n- 01 GET `/api/user/all`\n- 02 GET `/api/user/find/:id`\n- 03 POST `/api/user/register`\n- 04 PUT `/api/user/update/:id`\n- 05 DELETE `/api/user/delete/:id`\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdus%2Fnode-blog-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabdus%2Fnode-blog-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdus%2Fnode-blog-api/lists"}