-
Notifications
You must be signed in to change notification settings - Fork 9
Developer Tips and Tricks
The Mongoose NPM package provides the connectivity to MongoDB. See here for compatibility of Mongoose versions and MongoDB versions. Right now with Mongoose 5.X it supports MongoDB 3.0+.
Use nodemon
to automatically restart the node.js server upon code changes.
nodemon app.js
Use eslint to find stylistic and other code problems. See the .eslintrc.js
config file. Run the checker using:
./node_modules/.bin/eslint .
Leverage Super Linter in offline-mode to check for code linting and format issues before it's run via Github actions. It requires Docker.
docker run -e RUN_LOCAL=true -v ~/src/kort/:/tmp/lint/ github/super-linter
Functional unit-testing with Casperjs
Run the following to run the test suite:
npm test
Install mongo-express in the main kort folder:
npm install mongo-express
Start the app with:
node app.js
View the web UI via: http://localhost:8081
Alternatively, Robo3T is a nice Open Source desktop client as well.
Check if the Kort and Mongo containers are running:
sudo docker ps
Edit package.json
and rev the version.
Use a git tag with the appropriate version string (e.g. "v1.0.1"). Push the tag up to Github. This will automatically create a release in Github and publish a release to npmjs.com via a Github action.
https://www.npmjs.com/package/@carlsonp/kort
Utilize the npm-check-updates
package to update the package.json
file.
npm install -g npm-check-updates
ncu
ncu -u
Then run the following to install these updates packages.
npm install