Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shaaanuu/blog-backend
https://github.com/shaaanuu/blog-backend
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/shaaanuu/blog-backend
- Owner: shaaanuu
- Created: 2024-07-15T07:47:30.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-07-15T08:01:13.000Z (5 months ago)
- Last Synced: 2024-07-15T09:39:35.795Z (5 months ago)
- Language: JavaScript
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Blog Backend
This is the backend for a blog application, built using Node.js, Express and MongoDB
## Features
- RESTful API for blog posts
- CRUD operations
- MongoDB for data storage
- Environment variable support## Technologies Used
- Node.js
- Express
- MongoDB## Getting Started
### Prerequisites
- Node.js installed
- MongoDB instance (local or cloud)
- A `.env` file with the MongoDB URI### Installation
1. Clone the repository:
```bash
git clone https://github.com/shaaanuu/blog-backend.git
```2. Navigate to the project directory:
```bash
cd blog-backend
```3. Install dependencies:
```bash
npm install
```4. Create a `.env` file in the root of the project and add your MongoDB URI:
```env
MONGO_URI=mongodb://your_mongo_uri
```### Running the Server
Start the development server:
```bash
npm run dev
```The server will be running on `http://localhost:5000`.
## API Endpoints
### Blog Posts
- **GET /posts**: Get all blog posts
- **GET /posts/:id**: Get a single blog post by ID
- **POST /posts**: Create a new blog post
- **PUT /posts/:id**: Update a blog post by ID
- **DELETE /posts/:id**: Delete a blog post by ID## License
This project is licensed under the ISC License.