#LiveAPI ~ backend
LiveAPI is an app created to examine if API's are running successfully or if the API's are currently redundant.
The general idea of the app was generated by the team discussing issues we have been through throughout the bootcamp and what we can do to resolve it.
Users can also add an API, delete an API, recieve links to the DOCS and also recieve data in a JSON file.
What we used on the backend consisted of:
React
To run this project, install it locally using npm:
$ npm install
$ npm start
By doing this, users can have access to fully maximise the app itself
In the backend, there are dependencies and dev dependencies to install. These are the dependencies to install:
express
pg
The dev dependencies to install are:
dotenv
morgan
nodemon
jest
|-------------------------------------------------------------------------------------------------------------------------------------------|
| Request | Request body | Response status | Response body |
|---|---|---|---|
| GET /apis/ | none | 200 | { success: true, payload: an array of api objects} |
| POST /apis/ | { api_name, api_url, tags, doclink } | 201 | { success: true, payload: newly created api object } |
| POST /apis/ | Missing/invalid request body | 400 | { success: false, error: any string } |
| DELETE /apis/some_id | none | 200 | { success: true, payload: deleted api object} |
| PATCH /apis/some_id | Parameters ** probably unnecessary | 201 | { success: true, payload: updated api object} |
| ------------------------------------------------------------------------------------------------------------------------------------------- |
As a group, we made several tests to make sure the code we wrote was running the way we wanted it to. By using Jest, Supertest and also React test libraby, we were able to see if it was running successuly or not.
To run tests, run the following command
npm run test