This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@steeplejack/express

1.0.1 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i @steeplejack/express

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • npm