Backend para la conexion con la base de datos de Bitmarketperu
Carácteristicas:
- ECMAScript 6
- Async/Await
- Express.JS
- JSON request support
- HTTP/HTTPS support
- Implementation of notifications with Mailgun API
- NPM
- Static Content
- Mongoose
Route | Method | Requires auth |
---|---|---|
/ | GET | false |
/login | GET | false |
Route | Method | Required Data | Optional Data | Description |
---|---|---|---|---|
/api/users | GET | none | none | Returns all registered users |
/api/users | GET | queryString: wallet | none | Returns a specified user by the wallet. |
/api/users | PUT | body: wallet, token | body: username, fullname, email | Update a user |
Route | Method | Required Data | Optional Data | Description |
---|---|---|---|---|
/api/auth/signup | POST | body: wallet | none | signup |
/api/auth/login | POST | body: wallet, token | none | Login |
/api/auth/logout | GET | none | none | Logout |
Route | Method | Required Data | Optional Data | Description |
---|---|---|---|---|
/api/transactions | GET | headers: token | none | Get the Transactions |
/api/transactions | GET | headers: token; queryString: wallet | none | Get the Transactions related to a user |
/api/transactions | PUT | headers: token; body: wallet, transactionId, status | none | Update the status of the Transactions |
-
Clone repo
$ git clone https://github.com/Bitmarketperu/backend.git
-
set the environment variables
DATABASE=YOUR_STRING_CONNECT MAILGUN_DOMAIN=YOUR_MAILGUN_DOMAIN MAILGUN_API_KEY=YOUR_MAILGUN_API_KEY MAINGUN_SENDER=<postmaster@YOUR_MAILGUN_DOMAIN>
-
Run the proyect:
$ npm start
Node version: v16.16.0
models configs
{ "dolOut": 3, "dolInp": 3, "solOut": 2, "solInp": 3, "maxSol": 10000, "maxDol": 1000, "limSol": 40000, "limDol": 15000, "maxCrypto": 4000, "sellBit": 3.5, "buyBit": 2.5 }