A restful Jobs API
Client: No Frontend!!
Server: Node, Express, MongoDB
Clone the project
git clone https://github.com/co-bby/jobs
Go to the project directory
cd <projectname>
Install dependencies
npm install
Start the server
nodemon
To run this project, you will need to add the following environment variables to your .env file
These are examples
MONGO_URI
= mongodb+srv://username:@cluster0.9t7ho.mongodb.net/Jobs-API?retryWrites=true&w=majority
JWT_SECRET
= WfTkWnZq4t7w!z%C*F-JaMdKgUkXp2s5
JWT_LIFETIME
= 30d
POST /api/v1/auth/register
Req.body | Value | Remarks |
---|---|---|
username |
Unique username |
Required. Eg: Cobby |
password |
New user's password |
Required User password from 6-20 characters |
Email |
New user's E-mail |
Required. |
{
"user": {
"name": username
},
"token": auth token
}
POST /api/v1/auth/login
Req.body | Value | Remarks |
---|---|---|
username |
Registered Unique username |
Required. Eg: Cobby |
password |
Registered user's password |
Required User password from 6-20 characters |
{
"user": {
"name": username
},
"token": auth token
}
POST /api/v1/jobs
Req.body | Value | Remarks |
---|---|---|
company |
company name |
. Eg Apple |
Position |
job Position |
Eg Senior Engineer |
req.headers.authorization | Value | Remarks |
---|---|---|
authorization header |
Bearer + " " auth token |
Eg: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2M2M2OW |
Get /api/v1/jobs
Get/Patch/Delete /api/v1/job/{jobID}