Module for creating and managing HTTP servers.
Create a server with hs.httpserver.create(), configure it with chainable setters,
then call start(). The server accepts both synchronous and async (Promise-returning)
request handler callbacks.
Quick start
constserver = hs.httpserver.create() .setPort(8080) .setCallback((method, path, headers, body) => { return {body:"<h1>Hello from Hammerspoon!</h1>", status:200, headers: {"Content-Type":"text/html"}} }) .start() console.log("Listening on port " + server.getPort())
Module for creating and managing HTTP servers. Create a server with
hs.httpserver.create(), configure it with chainable setters, then callstart(). The server accepts both synchronous and async (Promise-returning) request handler callbacks.Quick start
Async callback
Static file serving
TLS (HTTPS)