cd dox3
to start the frontend:
npm run dev
or npm run build
to start the backend:
cd server
node app.js
- To do list
- Clock (literally)
- Sticky Notes
- Timer
- Desktop App
- Lofi Songs
- Customizable Color
- Username
- Lofi SFX
http://localhost:3000/api
- URL:
/stories
- Method:
POST
- Request Body:
{ "title": "Story Title", "content": "Story Content" }
- Response:
- Status:
200 OK
- Body:
{ "id": 1 }
- Status:
- Description: Creates a new story and returns the ID of the newly created story.
- URL:
/stories
- Method:
GET
- Response:
- Status:
200 OK
- Body:
{ "stories": [ { "id": 1, "title": "Story Title", "content": "Story Content" } ] }
- Status:
- Description: Retrieves a list of all stories.
- URL:
/stories/:id
- Method:
GET
- URL Parameters:
id
(integer): The ID of the story to retrieve.
- Response:
- Status:
200 OK
- Body:
{ "story": { "id": 1, "title": "Story Title", "content": "Story Content" } }
- Status:
- Description: Retrieves the details of a single story by ID.
- URL:
/stories/:id
- Method:
PUT
- URL Parameters:
id
(integer): The ID of the story to update.
- Request Body:
{ "title": "Updated Title", "content": "Updated Content" }
- Response:
- Status:
200 OK
- Body:
{ "changes": 1 }
- Status:
- Description: Updates the details of a story by ID and returns the number of changes.
- URL:
/stories/:id
- Method:
DELETE
- URL Parameters:
id
(integer): The ID of the story to delete.
- Response:
- Status:
200 OK
- Body:
{ "changes": 1 }
- Status:
- Description: Deletes a story by ID and returns the number of changes.
curl -X POST http://localhost:3000/api/stories -H "Content-Type: application/json" -d '{"title":"My First Story","content":"This is the content of my first story."}'
curl -X GET http://localhost:3000/api/stories
curl -X GET http://localhost:3000/api/stories/1
curl -X PUT http://localhost:3000/api/stories/1 -H "Content-Type: application/json" -d '{"title":"Updated Title","content":"Updated Content"}'
curl -X DELETE http://localhost:3000/api/stories/1