iamdileepkumar / node-mongo-scratch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

node-mongo-scratch

this repository illustrates use of the the following packages to construct node based batch and rest-ful api elements backed by mongodb:

XO code style styled with prettier

Directions

  1. git clone {this repo}
  2. cd {this repo}
  3. yarn
  4. yarn start
  5. visit http://localhost:3000 in browser

database

to run local mongo, easiest is via docker:

docker rm -f mongo
docker run -d --name mongo -v $HOME/mongo:/data/db -p 27017:27017 mongo:<version>

see config

initial data setup

see data setup

security setup

see security

batch example

see batch

build

  1. yarn build

tests

  1. run one of the following yarn commands
  2. yarn test (run all tests)
  3. yarn ava (run all unit tests)
  4. yarn ava-one {path to test} (run specific unit test)
  5. yarn cuke (run all cucumber tests)
  6. yarn cuke-feature {path to feature} (run tests for a specific cucumber feature)

    e.g. yarn cuke-feature test/features/widgets.feature

  7. yarn cuke -- --name='{scenario name regex}' (run a specific scenario)

    e.g. yarn cuke --name='create a client'

About


Languages

Language:JavaScript 66.8%Language:Gherkin 25.9%Language:Shell 7.3%