{"id":20597471,"url":"https://github.com/elliotalien/blog-api","last_synced_at":"2026-04-13T13:32:23.260Z","repository":{"id":241263906,"uuid":"804725262","full_name":"elliotalien/BlOG-API","owner":"elliotalien","description":"This project provides a simple API for creating and retrieving blog posts. It uses Express.js for handling HTTP requests, Mongoose for interacting with a MongoDB database, and services for handling business logic.","archived":false,"fork":false,"pushed_at":"2024-05-23T07:05:41.000Z","size":21,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-11T13:14:04.946Z","etag":null,"topics":["api","blog","elliotalien","mongodb","mvc","nodejs","postman"],"latest_commit_sha":null,"homepage":"https://blog-api-27t6.onrender.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elliotalien.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-05-23T06:33:22.000Z","updated_at":"2024-06-07T11:47:15.000Z","dependencies_parsed_at":"2024-05-23T07:53:58.941Z","dependency_job_id":null,"html_url":"https://github.com/elliotalien/BlOG-API","commit_stats":null,"previous_names":["elliotalien/blog-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/elliotalien/BlOG-API","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotalien%2FBlOG-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotalien%2FBlOG-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotalien%2FBlOG-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotalien%2FBlOG-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elliotalien","download_url":"https://codeload.github.com/elliotalien/BlOG-API/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotalien%2FBlOG-API/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31754913,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T13:27:56.013Z","status":"ssl_error","status_checked_at":"2026-04-13T13:21:23.512Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","elliotalien","mongodb","mvc","nodejs","postman"],"created_at":"2024-11-16T08:22:36.852Z","updated_at":"2026-04-13T13:32:23.238Z","avatar_url":"https://github.com/elliotalien.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Blog API\n\nThis project provides a simple API for creating and retrieving blog posts. It uses Express.js for handling HTTP requests, Mongoose for interacting with a MongoDB database, and services for handling business logic.\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [Environment Variables](#environment-variables)\n- [API Endpoints](#api-endpoints)\n- [Dependencies](#dependencies)\n- [License](#license)\n\n## Installation\n\nTo set up and run this project, follow these steps:\n\n1. Clone the repository:\n\n   ```\n    git clone https://github.com/elliotalien/BlOG-API.git\n    cd BlOG-API\n\n   ```\n\n2.Install the dependencies:\n\n```\nnpm install\n\n```\n\n3.Ensure you have a .env file in the root of your project with your MongoDB URI and other necessary environment variables. For example:\n\n```\nPORT=3000\nMONGO_URI=mongodb://localhost:27017/your-database-name\n\n```\n\n## Usage\nTo start the server, use the following command:\n\n```\nnpm start\n\n```\n\nMake sure to include the connectDB function from the previous part to establish the database connection when starting your server.\n\n## Environment Variables\nThis utility uses the following environment variables:\n\nPORT: The port on which the server will run.\nMONGO_URI: The connection string for your MongoDB database.\nMake sure to create a .env file in the root of your project and add the PORT and MONGO_URI variables with their respective values.\n\n## API Endpoints\n- Create a Blog Post\n- URL: /createblog\n- Method: POST\n- Description: Creates a new blog post.\n- Request Body:\n  \n```\n{\n  \"titleheading\": \"Your Blog Title\",\n  \"titledescription\": \"A short description\",\n  \"description\": \"Your blog content...\",\n  \"imageUrl\": \"http://example.com/image.jpg\"\n}\n\n```\n\n## Response:\n- 200 OK on success with a message and the created blog post data.\n- 500 Internal Server Error if there is an error.\n  \n## Get All Blog Posts\n- URL: /getposts\n- Method: GET\n- Description: Retrieves all blog posts.\n   - Response:\n     - 200 OK with the list of blog posts.\n     - 500 Internal Server Error if there is an error.\n       \n## Dependencies\n- express: Fast, unopinionated, minimalist web framework for Node.js.\n- mongoose: Mongoose is an Object Data Modeling (ODM) library for MongoDB and Node.js.\n- dotenv: Dotenv is a zero-dependency module that loads environment variables from a .env file into process.env.\n- cors: CORS is a node.js package for providing a Connect/Express middleware that can be used to enable CORS with various options.\n- To install the dependencies, use the following command:\n\n```\nnpm install express mongoose dotenv cors\n\n```\n\n# HAPPY CODING 😍😍\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felliotalien%2Fblog-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felliotalien%2Fblog-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felliotalien%2Fblog-api/lists"}