0.1.0 • Published 5 years ago

@autotelic/dev-server-module v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

dev-server-module

This module gets you up and running fast with a local development server.

How to use

  • in your project root install this module with npm install @autotelic/dev-server-module
  • create a file to import & use this module, e.g. runDevServer.js

Here's an example of what your runDevServer.js could look like:

import devServer from '@autotelic/dev-server-module';
import defaultDevRouter from '@autotelic/dev-server-module';
import mockFunction from '@autotelic/dev-server-module';

devServer.instantiateRouter(defaultDevRouter('/rates', mockFunction));

This exact example above will create a dev server with the default router at the /rates route. Instead of the mockFunction you should import your function and pass it ot the defaultDevRouter as the second argument.

If you want to create your own router and not use the provided defaultRouter, you can pass your router to devServer.instantiateRouter(<YOUR_ROUTER>).

- to run the dev server locally, execute the command `node runDevServer.js` from within your project.