Would you like to clone this notebook?

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

Cancel

Koa.js static HTML Server

node v16.18.0
version: 1.0.0
endpointsharetweet
/* Koa is far more modular than express by design, and thus should be much faster to boot up on the fly. The modularity was intended to make it easyer to extend, aswell as to allow microservices and scale to zero in Node.js. */ var Koa = require("koa") const html = ` <!doctype html> <html> <head> <meta charset="utf-8"> </head> <body> <iframe src="https://codesandbox.io/embed/xk52mqm7o?fontsize=14&hidenavigation=1&theme=dark" style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;" title="Feathers-vuex - Quick start" allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking" sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts" ></iframe> </body> </html> ` const app = new Koa(); // response app.use(ctx => { ctx.body = html }) app.listen(3000)
Created from: https://npm.runkit.com/koa
Loading…

no comments

    sign in to comment