Indie Web Server
Indie Web Server1 is a secure and seamless Small Tech personal web server.
Use it to seamlessly serve your personal static web site in development and production or build your own dynamic web app on top of it using JavaScript and Node.js.
Indie Web Server is as easy as it gets.
Features
-
Zero-configuration β It Just Works π€β’.
-
Develop and test with seamlessly-provisioned locally-trusted mkcert TLS certificates via Nodecert.
-
Stage and deploy with automatically-provisioned globally-trusted Letβs Encrypt TLS certificates via ACME TLS2
Install
$ npm i -g @ind.ie/web-server
Use
Command-line
Start serving the current directory at https://localhost:
$ web-server
Start serving the site directory at your hostname:
$ web-server site --global
For example, if you run the command on a connected server that has the ar.al domain pointing to it and ar.al
set in /etc/hostname (on Unix/Linux/macOS), you will be able to access the site at https://ar.al. The first time you hit it, it will take a little longer to load as your Letβs Encrypt certificates are being automatically provisioned by ACME TLS.
API
You can also use Indie Web Server programatically as the basis of you own web applications.
Examples
Serve the current directory at https://localhost using locally-trusted TLS certificates:
const webServer = require('@ind.ie/web-server')
const server = webServer.serve()
Serve the current directory at your hostname using globally-trusted Letβs Encrypt TLS certificates:
const webServer = require('@ind.ie/web-server')
const server = webServer.serve({global: true})
Create a custom server:
const webServer = require('@ind.ie/web-server')
const express = require('express')
const app = express()
app.use(express.static('.'))
const options = {} // to use globally-trusted certificates instead, set this to {global: true}
const server = webServer.createServer(options, app).listen(443, () => {
console.log(` π Serving on https://localhost\n`)
})
For full details of the command-line syntax and API, please see the documentation.
-
Previously known as HTTPS Server. ↩︎
-
Receives an A on the SSL Labs SSL Server Test. ↩︎