
Security News
Meet Socket at Black Hat Europe and BSides London 2025
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.
koa-simple-web
Advanced tools
A simple web server using Koa
$ npm install koa-simple-web
const web = new SimpleWeb({ port: 8080 });
web.route(new (require("koa-router"))());
web.use(async (ctx) => {});
await web.start();
await web.stop();
Koa's listen (which SimpleWeb uses) is itself sugar for
const http = require("http");
const Koa = require("koa");
const app = new Koa();
http.createServer(app.callback()).listen(3000);
Consequently, if you want to configure the underlying server instance (for example to use HTTPS), you can pass in a Node http.Server or https.Server to the constructor and that server will be used instead of a default HTTP configuration.
const fs = require('fs');
const https = require('https');
const options = {
key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem')
};
const server = https.createServer(options);
const web = new SimpleWeb({ port: 8080 }, server);
await web.start();
// curl -v https://localhost:8080/
When developing simple/small node HTTP services (eg: microservices) that don't require a big web framework, a simple web server that can started (and stopped) is needed.
There wasn't one before, so there is now.
MIT
FAQs
A simple web server using Koa
The npm package koa-simple-web receives a total of 1 weekly downloads. As such, koa-simple-web popularity was classified as not popular.
We found that koa-simple-web demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.