Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

APIs Rest com NodeJS

79 views

Published on

Palestra apresentada no dia 07/12/2018 no TDC Porto Alegre na trilha de NodeJS - Hoje o uso de APIs são indispensáveis, vamos descobrir qual o seu poder e o como podemos criar uma com pouco conhecimento de NodeJS e nenhum MongoDB, todas as ferramentas e conhecimentos necessários.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

APIs Rest com NodeJS

  1. 1. Globalcode – Open4education Trilha NodeJS – APIs Rest com NodeJS Jakeliny Gracielly Web Developer, Solutions Leader @ FCamara
  2. 2. Globalcode – Open4education O que é uma API Rest? ● Disponibiliza recursos de uma aplicação ● Possibilitar integração de sistemas ● Get, Put, Input, Delete ● Requisições HTTP
  3. 3. Globalcode – Open4education Getting Started NodeJS
  4. 4. Globalcode – Open4education Como é a realidade?
  5. 5. Globalcode – Open4education TypeScript ● Superset do JavaScript ● Tipado e Orientado a Objeto ● Usado em FrameWorks como Angular2 + ● Interpreta para JS puro
  6. 6. Globalcode – Open4education npm init
  7. 7. Globalcode – Open4education Módulos npm install body-parser express http-status mongoose ● Express ● Mongoose ● Http-status ● Body Parser
  8. 8. Globalcode – Open4education Módulos Configurações do projeto Início - rotas, middleware, ... Monitorar a porta da aplicação Configurações do compilador do TypeScript
  9. 9. Globalcode – Open4education Compilador TS
  10. 10. Globalcode – Open4education Configurando npm start Em nosso package.json...
  11. 11. Globalcode – Open4education app.ts
  12. 12. Globalcode – Open4education server.ts
  13. 13. Globalcode – Open4education npm start http://localhost:4200
  14. 14. Globalcode – Open4education Conectar com MongoDB
  15. 15. Globalcode – Open4education Conectar com MongoDB
  16. 16. Globalcode – Open4education Conectar com MongoDB
  17. 17. Globalcode – Open4education npm start
  18. 18. Globalcode – Open4education Criando os módulos
  19. 19. Globalcode – Open4education crushs/schema.ts
  20. 20. Globalcode – Open4education crushs/repository.ts
  21. 21. Globalcode – Open4education crushs/controller.ts
  22. 22. Globalcode – Open4education crushs/routes.ts
  23. 23. Globalcode – Open4education crushs/routes.ts
  24. 24. Globalcode – Open4education crushs/routes.ts
  25. 25. Globalcode – Open4education app.ts
  26. 26. Globalcode – Open4education Chamando a rota getAll
  27. 27. Globalcode – Open4education Chamando a rota getByID
  28. 28. Globalcode – Open4education Tutorial
  29. 29. Globalcode – Open4education OBRIGADA! jakeliny.com.br @jakelinygracielly @jakelinygr Jakeliny Gracielly Web Developer, Solutions Leader @ FCamara

×