A simple microservice for getting information about employees from the ERP odoo.
The current available endpoint for the api are the next one:
/employees
: GET
# Request params
id - numeric (optional)
name - string (optional)
email - string (optional)
company - string (optional)
{
"status": 200,
"msg": "success",
"data": [
{
"id": 1,
"name": "Administrator",
"job_id": null,
"job_title": null,
"department_id": 1,
"department": "Administration",
"parent_id": null,
"parent_name": null,
"coach_id": null,
"company_id": 1,
"company": "Caresle Company",
"work_email": "[email protected]",
"work_phone": null,
"mobile_phone": null,
"pin": null
}
]
}
You need to have a odoo database for the project to work, also see Docker if you want to deploy the project using docker.
- Clone the repository
- Install the dependencies with:
npm i
- Copy
.env.example
and rename for.env
- Set up the
.env
variables - Build the project with:
npm run build
- Start the project with:
npm run start
If you want to use docker follow the previous step, just run these additional commands.
- For building the docker image
docker build -t odoo_microservice ./
- For start the container (remember that the odoo db need to be running)
docker run --name employees_microservice -p 3005:3005 -d odoo_microservice
Replace the -p with <PORT_HOST>:<PORT_IN_THE_ENV_FILE> for the app to run