Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.

Cancel

Endpoint with Express

node v16.10.0
version: 0.0.0
endpointsharetweet
var express = require("express") function runkitExpress(anExport) { var mount = express(); var app = express(); // "mount" is our root app, and it mounts "app" at your notebook path // which is available in the RUNKIT_MOUNT_PATH environment variable mount.use(process.env.RUNKIT_MOUNT_PATH || "", app); if (anExport) { anExport.endpoint = mount; } // overwrite .listen since it is not needed app.listen = function(){} // return the express instance for use by the caller return app; } module.exports = runkitExpress
Use this helper to quickly return a RunKit Endpoint compatible express app, in place of calling express directly. Here's an example use: https://runkit.com/runkit/express-endpoint-demo.
(using newer version of Express)
Loading…

no comments

    sign in to comment