- NodeJS/Express
- PostgreSQL
- js library pg to establish low-level connection between app and database
- supertest for testing
In root directory, run the following command: node server.js
As with other RESTful APIs, it's helpful to use a platform like Postman or Insomnia to see test how the application responds to different requests.
The company and job routes require user authentication. When you login or sign up, the app will return a token which you can then send along with your other requests.
Get companies route with authentication:
Note that application depends the value of token to be stored in key _token
.
get
request tobaseurl/companies
: returns list of all companies. This route also accepts the following query parameters to filter results:search
,min_employees
andmax_employees
For example, the following get request can expect a resource of all companies with the word apple somewhere in the name and and that have at least 2000 employees.baseurl/companies?search=apple&min_employees=2000
post
request tobaseurl/companies
: Adds a new company to database. Requires admin authorization.get
request tobaseurl/companies/<handle>
with handle being the company handle will receive a resource on all details for that company.update
anddelete
requests can be made to a specific company by following the following route:baseurl/companies/<handle>
where the handle is the company's handle. This route requires admin authorization.
get
request tobaseurl/jobs
: returns list of all jobs in database. This route also accepts the following query params:search
,min_salary
andmax_salary
post
request tobaseurl/jobs
: Adds a new job to database. Requires admin authorization.get
request tobaseurl/jobs/<id>
with id being the job id will receive a resource on all details for that id.update
anddelete
requests can be made to a specific job by following the following route:baseurl/job/<id>
where the id is the job id. This route requires admin authorization.
In root directory, run the following command:
jest