This project is part of Mashgin Software Engineer assignment.
You can access the deployed projecy on https://mashgin-api.victorbalbo.com/ hosted by Vercel.
node
as JS runtimeexpress
for web frameworkTypeScript
for variables typingZod
for schema validationJest
for tests
This project is a dependency for the mashgin-webapp. Also the published API can be found at https://mashgin-api.victorbalbo.com/.
This project can run in two ways, using Docker
or using Node
commands.
Before running this API is necessary to set the Token for GIST access. The token was sent on the email.
You can change the default value for the variable githubToken
on the file src/constants.ts
; Or create a .env
file defining the variable value like the exempla bellow:
GITHUB_TOKEN=TOKEN
To run this project using Docker you will need to have a Docker Engine
and Docker CLI
installed and running.
docker build . -t mashgin-api
docker run -p 3000:3000 mashgin-api
This will run the webapp locally though Docker
using port 3000. The app will run on http://localhost:3000/
To run this project using Node you will need to have a Node 18+
installed. You can check your node version using the command node -v
.
npm install
npm run dev
This will run the webapp locally using port 3000. The app will run on http://localhost:3000/
This project uses Jest
for unit tests of the controllers and business logic.
To run the tests just run the command:
npm run test
This API uses Swagger when run locally to document and present the endpoints. Once the API is running locally you can check the docs on the at http://localhost:3000/docs/