32 lines
750 B
Markdown
32 lines
750 B
Markdown
# 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.
|