eswat2 / mock-x42

minimal mock api server with tools required for fake data...

Home Page:https://mock-x42.eswat2.now.sh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mock-x42

a simple mock api server...

deployed

usage

  • yarn install
  • yarn dev - uses nodemon, see below
➜ mock-api git:(master) yarn dev
yarn run v1.17.3
$ nodemon server
[nodemon] 1.19.2
[nodemon] to restart at any time, enter `rs`
[nodemon] watching dir(s): *.*
[nodemon] starting `node server.js`
Magic happens here -- http://localhost:8180
         mock apis -- http://localhost:8180/api/mock
        sample api -- http://localhost:8180/api/mock/auto
--

docker

if you prefer, you can run this in docker.

  • yarn build - docker-compose build
  • yarn up - docker-compose up
  • yarn down - docker-compose down
➜ mock-api git:(master) ✗ yarn up
yarn run v1.17.3
$ docker-compose up
Creating network "mock-api_default" with the default driver
Creating mock-api_web_1 ... done
Attaching to mock-api_web_1
web_1  | yarn run v1.15.2
web_1  | $ node server
web_1  | Magic happens here -- http://localhost:8180
web_1  |          mock apis -- http://localhost:8180/api/mock
web_1  |         sample api -- http://localhost:8180/api/mock/auto
web_1  | --

tests

  • yarn test - run tests, single pass
  • yarn ct - run tests, continuously
  • yarn coverage - run coverage report
--------------|----------|----------|----------|----------|-------------------|
File          |  % Stmts | % Branch |  % Funcs |  % Lines | Uncovered Line #s |
--------------|----------|----------|----------|----------|-------------------|
All files     |      100 |      100 |      100 |      100 |                   |
 api          |      100 |      100 |      100 |      100 |                   |
  utils.js    |      100 |      100 |      100 |      100 |                   |
 api/data     |      100 |      100 |      100 |      100 |                   |
  colors.js   |      100 |      100 |      100 |      100 |                   |
  gtSports.js |      100 |      100 |      100 |      100 |                   |
 api/sample   |      100 |      100 |      100 |      100 |                   |
  mock.js     |      100 |      100 |      100 |      100 |                   |
  router.js   |      100 |      100 |      100 |      100 |                   |
--------------|----------|----------|----------|----------|-------------------|
✨  Done in 1.44s.

dependencies

who

About

minimal mock api server with tools required for fake data...

https://mock-x42.eswat2.now.sh


Languages

Language:JavaScript 99.6%Language:Dockerfile 0.4%