Skip to content

impactbyte-learn/impactodo-api-easy

Repository files navigation

Impact Todo API (Easy version)

App Structure

index.ts
▼
TypeORM connection
├─ Express configuration
├─── app.use(...)
└─── app.use("/todos", TodoRoutes)
▼
routes
├─ TodoRoutes
├─── router.get("/", TodoController.findAll)
└─── router.post("/", TodoController.create)
▼
controller
├─ TodoController
├─── findAll(req, res, next) => { Todo.find ... res.send(todos) }
└─── create(req, res, next) => { newTodo.save ... res.send(newTodo) }
▼
entity
├─ Todo
├─── @IdColumn id: number / ObjectID
└─── @Column text: string
▼
database
├─ MongoDB
├─── localhost:27017/impactodo
├─ PostgreSQL
├─── localhost:5432/impactodo
├─ MySQL
└─── localhost:3306/impactodo

How to Run

Database:

sudo service mongod start
sudo service postgresql start

Installation:

npm install

Development:

npm run dev

Start:

npm run start

Releases

No releases published

Packages

No packages published