Seminar 7 – simple CRUD api

1) Porneste un workspace nou cu NodeJs in cloud9 (sterge toate fisierele autogenerate)

2) Instaleaza MySQL

mysql-ctl start

3) Descarca exemplul https://github.com/eduardbudacu/webtech-prj-sciencedb/archive/master.zip

wget https://github.com/eduardbudacu/webtech-prj-sciencedb/archive/master.zip

unzip nume_fisier

4) Ruleaza comanda

cd nume_director

npm install

5) Instaleaza nodeadmin (https://www.npmjs.com/package/nodeadmin)

npm install –save nodeadmin

6) Creaza o tabela pentru proiectul tau care sa contina

  • id, int(8), AUTO_INCREMENT
  • cel putin 3 atribute

7) Instaleaza Sequelize urmand instructiunile de instalare http://docs.sequelizejs.com/en/v3/docs/getting-started/

8) In cadrul laboratorului dezvoltam metodele CRUD

CREATE

  • POST /nume_entitate

READ

  • GET /nume_entitate
  • GET /nume_entitate/:id

UPDATE

  • PUT /nume_entitate/:id

DELETE

  • DELETE /nume_entitate/:id

Leave a Reply

Your email address will not be published. Required fields are marked *