0.1.0 • Published 3 years ago

@totallymoney/filename-basepath v0.1.0

Weekly downloads
292
License
MIT
Repository
github
Last release
3 years ago

Filename Basepath

Mount express routes using filename as basepath.

Useful for efficiently mocking multiple http dependencies.

Example

$ yarn add -D @totallymoney/filename-basepath
$ tree
.
├── mocks
│   └── my-route.js
└── package.json
$ cat mocks/my-route.js

var router = require("express").Router();

router.get("/foo", function (_, res) {
  res.send("bar");
});

module.exports = router;
$ yarn filename-basepath mocks

Sourcing routes from: my-repo/mocks
/my-route
Running on port 3000
$ curl -s http://localhost:3000/my-route/foo

"bar"

Development

Make sure you belong to the totallymoney npm organization. Then make changes to the source code and publish. Enter the new version number as prompted. A git push command will run automatically after publishing.

$ git commit -am "Improve logging"
$ yarn publish --access public
0.1.0

3 years ago

0.0.6

3 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago