Tech companies is a simple nodejs app that lists information about tech companies in nigeria. CRUD methods have been created to do the following:
- Get all companies
- Add a company
- Get one company
- Edit company details
- Delete a company
Built With
- nodejs, express, postgress & hosted on heroku
Trying to get started?
- Make sure to have node, git installed on your computer
- Clone this project using this link - https://github.com/bellogo/tech-companies.git
- Create a .env file and add all the variables as shown in the sample
- Run
npm installto install the modules - Run
npm run devto start the server - Run
npm testto run the test suite
These are the HTTP request methods used in this project:
| Method | Action |
|---|---|
GET |
This method is used to get a resource |
POST |
This method is used to create a resource or send data |
PUT |
This method is used to update a resource |
DELETE |
This method is used to delete a resource |
These are the HTTP response codes used in this project:
| Status Codes | Indication |
|---|---|
200 |
This OK status code indicates that a request has succeeded |
201 |
This created status code indicates that a resource has been created |
400 |
This bad request error status code indicates that the request sent to the server is incorrect |
404 |
This not found status code indicates that the request/resource asked for can not be found |
The routes featured in this project:
| API routes(url) | Method | Description |
|---|---|---|
| / | GET |
Homepage |
| /api/companies | GET |
To get all companies |
| /api/company/:id | GET |
To get a company |
| /api/company | POST |
To add a company |
| /api/company/:id | PUT |
To update a company |
| /api/company/:id | DELETE |
To delete a company |
Usage:
- To add company make a
POSTrequest to:https://companies-ng.herokuapp.com/company
{
name: "Aladin's hub",
location: "Wadiya",
ceo: "Admiral General Aladin"
}
-
To get all companies make a
GETrequest tohttps://companies-ng.herokuapp.com/companies -
To get a company make a
GETrequest tohttps://companies-ng.herokuapp.com/company/:id -
To update a company make a
PUTrequest tohttps://companies-ng.herokuapp.com/company/:id -
To delete a company make a
DELETErequest tohttps://companies-ng.herokuapp.com/company/:id
Tested With
- Mocha
- Chai
👤 Author
- Github: @bellogo
- Linkedin: Ufuoma Ogodo
Contributions, issues and feature requests are welcome!
Give a ⭐️ if you like this project!