Giter Club home page Giter Club logo

blog-rest-api-nodejs-json-web-token's Introduction

blog-rest-api-nodejs-json-web-token

Exemplo para o blog http://rcdevlabs.github.io/

No post: Como criar uma API RESTfull em NodeJS e autenticar usando JSON Web Token JWT?

Para testar:

  1. Clone ou baixe. Edite no server.js, adicionando a URL do seu mongodb na var db

  2. entre com o terminal e rode node server

  3. Com POSTMAN ou outra ferramenta de http requests execute um POST com username e password para http://localhost:8080/api/usuarios

  4. Acesse com GET http://localhost:8080/api/usuarios e veja a restrição

  5. Faça o Login com um post para http://localhost:8080/api/login enviando username e password

  6. Copie o token que vc recebeu e adicione como header chamando de x-access-token

  7. Faça um GET para http://localhost:8080/api/usuarios e veja como funciona! :)

blog-rest-api-nodejs-json-web-token's People

Contributors

romuloctba avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.