Git Product home page Git Product logo

grpc-task's Introduction

grpc-task

Clone the repo

git clone --recurse-submodules --remote-submodules https://github.com/shovanmaity/grpc-task.git
cd grpc-task

Run the app

make run

Get profile without auth header

curl http://0.0.0.0:8090/api/v1/shovan/profile
{"code":16,"message":"authorization token not found","details":[]}

Update profile without auth header

curl -X PUT http://0.0.0.0:8090/api/v1/shovan/profile -d '{"name":"Shovan Maity", "email":"[email protected]"}'
{"code":16,"message":"authorization token not found","details":[]}

Registration

curl -X POST http://localhost:8090/api/v1/registration -d '{"username":"shovan", "password":"shovan"}'
{"jwt":"JWT_TOKEN"}

Login

curl -X POST http://localhost:8090/api/v1/login -d '{"username":"shovan", "password":"shovan"}'
{"jwt":"JWT_TOKEN"}

Get profile

curl http://0.0.0.0:8090/api/v1/shovan/profile -H "authorization: Token ${JWT_TOKEN}"
{"username":"shovan", "name":"", "email":""}

Update profile

curl -X PUT http://0.0.0.0:8090/api/v1/shovan/profile -H "Authorization: Token ${JWT_TOKEN}" -d '{"name":"Shovan Maity", "email":"[email protected]"}'

Get profile after update

curl http://0.0.0.0:8090/api/v1/shovan/profile -H "Authorization: Token ${JWT_TOKEN}"
{"username":"shovan", "name":"Shovan Maity", "email":"[email protected]"}

Logout

curl -X DELETE http://localhost:8090/api/v1/logout -H "authorization: Token ${JWT_TOKEN}"

Get profile after logout

curl http://0.0.0.0:8090/api/v1/shovan/profile -H "Authorization: Token ${JWT_TOKEN}"
{"code":16, "message":"invalid session", "details":[]}

Update profile after logout

curl -X PUT http://0.0.0.0:8090/api/v1/shovan/profile -H "Authorization: Token ${JWT_TOKEN}" -d '{"name":"Shovan Maity", "email":"[email protected]"}'
{"code":16, "message":"invalid session", "details":[]}

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.