Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hops-express

Package Overview
Dependencies
Maintainers
1
Versions
191
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hops-express

Express server to enable server-side rendering of hops applications

  • 7.0.0-0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
376
increased by67.86%
Maintainers
1
Weekly downloads
 
Created
Source

Hops Express

hops-express creates a minimal Express server which takes care of serving static assets and registering the (through hops-build generated) middleware.

hops-express doesn't generate the middleware itself but assumes that it is named server.js inside the hopsConfig.cacheDir (see hops-config for more details).

API

createApp()

createApp() creates an Express app, applies all the middleware configuration and returns the app object ready to call app.listen(host, port) on it.

startServer(callback)

startServer() is a small wrapper around createApp() and executes app.listen() with the values provided through hops-config.

Target Audience

This package is intended for users that want to use server-side rendering with hops - be it on lambda, a local machine, heroku or anywhere else.

The node server contained in this app should be ready for production usage.

Example

serve.js

var hopsExpress = require('hops-express');

hopsExpress.startServer(function (error) {
  if (error) {
    console.error(error);
  } else {
    console.log('server started successfully');
  }
});

Keywords

FAQs

Package last updated on 10 Oct 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc