Skip to content

Latest commit

 

History

History
11 lines (8 loc) · 2.45 KB

metode-crud.md

File metadata and controls

11 lines (8 loc) · 2.45 KB

Metode CRUD

Această secțiune include referințele pentru implementarea metodelor CRUD pentru backend

Operație Metoda HTTP Express Sequelize
Create POST /resource router.post('/resource', handler) Model.create(data)
Read

GET /resource

GET /resource/:id

router.get('/resource', handler)

router.get('/resource/:id', handler)

Model.findAll(options)

Model.findByPk(id)

Update PUT /resource/:id router.put('/resource/:id', handler) obj.update(data)
Delete DELETE /resource/:id router.delete('/resource/:id', handler) obj.destoy()