Skip to content

alvinnyen/restaurant-search-service-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

restaurant-search-service-backend

mainly use JWT to do Authentication and Authorization

1. setup

  • bundle install Install the dependencies specified in the Gemfile.

2. start the server

3. endpoints

3.1. signup

  • HTTP Method: post
  • path: /user
  • data:
        {
            "username": $username,
            "password": $password
        }
    
  • response
        {
            "id": $id,
            "username": $username,
            "password_digest": $encrypedPassword,
            "created_at": $timestamp,
            "updated_at": $timestamp
        }
    

3.2. login

  • HTTP Method: post
  • path: /login
  • data:
        {
            "username": $username,
            "password": $password
        }
    
  • response
        {
            "user": {
                "id": $id,
                "username": $username,
                "password_digest": $encrypedPassword,
                "created_at": $timestamp,
                "updated_at": $timestamp
            },
            "jwt": $token // i.e. "eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxfQ.ETUYUOkmfnWsWIvA8iBOkE2s1ZQ0V_zgnG_c4QRrhbg"
        }
    

About

the backend of restaurant-search-service for serving api/data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published