Code Monkey home page Code Monkey logo

chainstack-coding-test's Introduction

Chainstack coding test

Environment tested

MacOS with docker v18.06, docker-compose v1.22

Running test

./scripts/run-test.sh

Running server

./scripts/run-test.sh

APIs available

  1. POST /auth Login
    Body format e.g.`{email: '[email protected]', password: 'abc'}
  2. POST /resources Create resource
    Body format e.g. {name: 'abc'}
  3. GET /resources List resource
    Query params support user_id for admin user to list resources for specific user
  4. DELETE /resources/:id Delete a resource
  5. POST /users Create user (admin only)
    Body format e.g. {email: '[email protected]', password: 'abc', role: 'normal', quota: 123}
  6. GET /users List users (admin only)
  7. DELETE /users/:id Delete user (admin only)
  8. PUT /users/:id/quota Update quota (admin only)
    Body format e.g. {quota: 123}

Authentication

After login successfully, you will get a token. Put the token in the Authorization header in the following format.

For eg. token = 123456
Authorization: Bearer 123455
Default expiry time is 2 hours later.

Required header

  1. Accespt: application/json
  2. Content-Type: application/json for POST and PUT requests

NOTE

  1. Database is not persistent. It can be made persistent by add volume mapping to db services.
  2. Default users are just one admin user [email protected]/abc

chainstack-coding-test's People

Contributors

coderek avatar

Watchers

James Cloos avatar  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.