implementation of the algorith siege of Eratosthenes, to calculate primes numbers.
is exposed as an api by default in port 3000. If you want to change it create an .env
file on the
root of the project.
# Set to production when deploying to production
NODE_ENV=development
# Node.js server configuration
SERVER_PORT=8080
to start the project, first do npm install
.
then run the following npm run dev
to start nodemon
on the browser expose the http://localhost:8080/prime_number/15
, the port could change.
It easy generate primes number of 1.000.000 and above.
The project was made with typescript and used mocha and chai for testting.
The project use husky and lint-staged for linting and fixing possible errors on source code before commit
Git hooks scripts are installed after running npm install
the first time
run nodemon to watch all changes, by default get an instance of express on port 3000.
Compile typescript files from the src
folder inside the lib
folder
Remove the following directories/files
- lib
- esm
- reports
Run tests files inside the tests
folder that matches the following patterns. Exit with code > 0 on
error
- *.test.ts
- *.spec.ts
The same as as npm test
and generates coverages reports in reports/coverage
. Exit with code > 0
on error
Check eslint errors according to .eslintrc
Run npm run lint
applying fixes and run prettier on every typescript file