https://github.com/bankole2000/spoke-todo-backend
Simple Node + Express Rest API for Spoke.ai coding challenge
https://github.com/bankole2000/spoke-todo-backend
Last synced: over 1 year ago
JSON representation
Simple Node + Express Rest API for Spoke.ai coding challenge
- Host: GitHub
- URL: https://github.com/bankole2000/spoke-todo-backend
- Owner: Bankole2000
- Created: 2021-11-21T18:57:47.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-11-21T21:10:57.000Z (over 4 years ago)
- Last Synced: 2025-04-09T18:12:53.337Z (over 1 year ago)
- Language: JavaScript
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Spoke Todo Api
A simple REST api to serve as a backend for the Frontend Engineering Role coding challenge [@Spoke.ai](https://spoke.ai)
Built with:
1. Node JS
2. Express
3. Prisma
4. PostgreSQL
5. Deployed to heroku
### Types
```js
type Subtask = {
title: string,
completed: boolean,
}
type Todo = {
id?: string | number,
title: string,
notes: string,
completed: boolean,
subtasks: Subtask[],
createdAt?: string,
updatedAt?: string
}
```
### API Base URL
Is currently running at - [https://spoke-todo.herokuapp.com/](https://spoke-todo.herokuapp.com/)
### End points
| Method | Path | Data | Response |
| ------ | ---------------- | ---------------------------------- | ------------------------------------------- |
| GET | "/" | null | Returns JSON object with some api meta data |
| GET | "/api/todos" | null | Returns all Todos in database |
| POST | "/api/todos" | todoItem: Todo | Returns created todo item |
| GET | "/api/todos/:id" | {params: id} | Returns single todo item of id :id |
| PUT | "/api/todos/:id" | {params: id} todo fields to update | Returns updated todo item |
| DELETE | "/api/todos/:id" | {params: id} | Returns deleted todo item id |
| DELETE | "/api/todos" | null | Deletes all todo items |