1.0.1 • Published 7 years ago

@steeplejack/express v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

Steeplejack Express

Express strategy for Steeplejack

Usage

In your Steeplejack bootstrapping, you'll need to import this Express plugin into the modules section:

app.js

const Steeplejack = require('steeplejack');
const express = require('@steeplejack/express');

/* Bootstrap the Steeplejack app */
const app = Steeplejack.app({
  config: {},
  modules: [
    `${__dirname}/!(node_modules|routes)/**/*.js`,
    express,
  ],
  routesDir: `${__dirname}/routes`,
});

app.run(['server'], server => server);

Now you've done that, you can create the server with the Express strategy:

server.js

exports.default = (Server, config, { Express }) => {
  const express = new Express();

  return new Server(config.server, express);
};

exports.inject = {
  name: 'server',
  deps: [
    'steeplejack-server',
    '$config',
    'steeplejack-express',
  ],
};

The steeplejack-express dependency exposes two elements, Express (the strategy) and expressLib (the express library).

License

MIT License

1.0.1

7 years ago

1.0.0

7 years ago

0.1.0

7 years ago