backend
This commit is contained in:
31
backend/README.md
Normal file
31
backend/README.md
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
# Todo App Backend
|
||||||
|
|
||||||
|
This is a standalone Node.js Express API for a Todo application.
|
||||||
|
|
||||||
|
## Features
|
||||||
|
- GET `/api/todos`: Fetch all todos
|
||||||
|
- POST `/api/todos`: Add a new todo
|
||||||
|
- GET `/`: Health check
|
||||||
|
|
||||||
|
## Standalone Setup
|
||||||
|
1. Clone this repository.
|
||||||
|
2. Install dependencies:
|
||||||
|
```bash
|
||||||
|
npm install
|
||||||
|
```
|
||||||
|
3. Start the server:
|
||||||
|
```bash
|
||||||
|
npm start
|
||||||
|
```
|
||||||
|
The server runs on port `3001` by default.
|
||||||
|
|
||||||
|
## Deployment
|
||||||
|
- **Port**: Set the `PORT` environment variable to change the listening port.
|
||||||
|
- **Docker**:
|
||||||
|
```bash
|
||||||
|
docker build -t todo-backend .
|
||||||
|
docker run -p 3001:3001 todo-backend
|
||||||
|
```
|
||||||
|
|
||||||
|
## Repository Independence
|
||||||
|
This repository has no dependencies on the frontend. It can be deployed anywhere (AWS, Heroku, DigitalOcean, etc.) independently.
|
||||||
5040
backend/package-lock.json
generated
Normal file
5040
backend/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
21
backend/package.json
Normal file
21
backend/package.json
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"name": "backend",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"start": "node index.js",
|
||||||
|
"test": "jest"
|
||||||
|
},
|
||||||
|
"keywords": [],
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"cors": "^2.8.6",
|
||||||
|
"express": "^5.2.1"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"jest": "^30.2.0",
|
||||||
|
"supertest": "^7.2.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user