Socket
Book a DemoInstallSign in
Socket

@steeplejack/express

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@steeplejack/express

Express strategy for Steeplejack

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

steeplejack

FAQs

Package last updated on 09 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts