1
0
Fork
You've already forked functions
0
A Node.js server for my serverless functions
  • JavaScript 100%
Robin Métral 9be9ab61fa Add support for protected Polarsteps trips
These are obfuscated behind a ?s secret which we now forward to the API.
We should expan the router to support query parameters.
2026年02月18日 23:13:48 +01:00
src Add support for protected Polarsteps trips 2026年02月18日 23:13:48 +01:00
.gitignore Initial commit 2026年01月17日 12:10:08 +01:00
jsconfig.json Initial commit 2026年01月17日 12:10:08 +01:00
LICENSE Initial commit 2026年01月17日 12:10:08 +01:00
package-lock.json Initial commit 2026年01月17日 12:10:08 +01:00
package.json Initial commit 2026年01月17日 12:10:08 +01:00
README.md Document rsync command on README 2026年01月17日 19:03:10 +01:00

Functions

This is a simple Node.js server that exposes a series of utility functions (think serverless functions but with a server). It replaces the need to deploy functions to big tech infrastructure such as AWS Lambda, Cloudflare Workers or Vercel Functions.

Environment

The server runs on Node.js v24. Newer versions should work but are untested. Anything below v23.8 will not work, because the router uses the URLPattern API.

Deployment

Copy the contents of the src directory to a web server, for example via SSH:

rsync -r --delete src/ user@ssh.example.com:<path>/functions
# `-r`: recursive
# `--delete`: delete files in dest that aren't in src
# `src/` (with trailing slash): copy dir contents, omit dir itself

There are no runtime dependencies. To start the server, simply run:

node index.js # in the /functions directory

The server expects two environment variables to be set:

  • IP: the IP to listed on, defaults to localhost
  • PORT: the port to listen on, defaults to 3000

Development

This project uses JSDoc for type checking, using your IDE's1 TypeScript server. To install the Node.js types package, run:

npm install

To start the local server, run:

npm start

By default, the server will listen on localhost:3000.


  1. I recommend VSCodium ↩︎