Giter Site home page Giter Site logo

sondaliamine / deploy-loopback-4-app-in-heroku Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mrmodise/deploy-loopback-4-app-in-heroku

0.0 0.0 0.0 82 KB

Demo to illustrate how to deploy a LoopBack 4 application in Heroku

Home Page: https://more-modise.medium.com/how-to-deploy-loopback-4-application-in-heroku-3d059b73cbd5

License: Other

JavaScript 1.14% Dockerfile 2.65% HTML 5.91% TypeScript 90.31%

deploy-loopback-4-app-in-heroku's Introduction

@loopback/example-todo-jwt

This is a modified LoopBack 4 Todo application with JWT authentication, using the @loopback/authentication-jwt extension.

Overview

This tutorial demonstrates how to add JWT authentication to the Todo application.

Usage

Start the application by running npm start and go to http://localhost:3000/explorer. You’ll see the 3 new endpoints under UserController together with the other endpoints under TodoController.

API Explorer screeshot

  1. Sign up using the/signup API

    Since we don’t have any users created, click on POST /signup. For the requestBody, the minimum you need is email and password. i.e.

    {
      "email": "[email protected]",
      "password": "testuser2"
    }
  2. Log in using thePOST /users/login API

    After calling /users/login , the response body will look something like:

    {
      "token": "aaaaaaaaa.aaaaaaaaaaaaaaaaa"
    }

    Copy the token. Go to the top of the API Explorer, click the “Authorize” button.

    API Explorer with Authorize Button

    Paste the token that you previously copied to the “Value” field and then click Authorize.

    authorize dialog

    In the future API calls, this token will be added to the Authorization header .

  3. Get all todos using GET /todos API You should be able to call this API successfully.

Contributions

Tests

Run npm test from the root folder.

Contributors

See all contributors.

License

MIT

LoopBack

deploy-loopback-4-app-in-heroku's People

Contributors

mrmodise 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.