forked from gitea_admin/simple-node
frontend
This commit is contained in:
1
frontend/.dockerignore
Normal file
1
frontend/.dockerignore
Normal file
@@ -0,0 +1 @@
|
||||
node_modules\n*.log
|
||||
1
frontend/.gitignore
vendored
Normal file
1
frontend/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
node_modules
|
||||
33
frontend/README.md
Normal file
33
frontend/README.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# Todo App Frontend
|
||||
|
||||
This is a standalone Node.js server that serves the Todo application's web interface.
|
||||
|
||||
## Standalone Setup
|
||||
1. Clone this repository.
|
||||
2. Install dependencies:
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
3. Start the server:
|
||||
```bash
|
||||
npm start
|
||||
```
|
||||
The frontend runs on port `3000` by default.
|
||||
|
||||
## Connecting to Backend
|
||||
The frontend needs to know where the Backend API is hosted.
|
||||
- **Development**: Defaults to `http://localhost:3001`.
|
||||
- **Production**: Set the `BACKEND_URL` environment variable when starting the server.
|
||||
```bash
|
||||
BACKEND_URL=https://api.yourdomain.com npm start
|
||||
```
|
||||
|
||||
## Deployment
|
||||
- **Docker**:
|
||||
```bash
|
||||
docker build -t todo-frontend .
|
||||
docker run -p 3000:3000 -e BACKEND_URL=https://your-api.com todo-frontend
|
||||
```
|
||||
|
||||
## Repository Independence
|
||||
This repository is completely separate from the backend repository. It communicates with the backend exclusively via HTTP calls to the `BACKEND_URL`.
|
||||
Reference in New Issue
Block a user