A fast, lightweight bun-powered web-server
241
This is a basic, lightweight web server using Bun as JavaScript/TypeScript runtime.
This app is really useful in some situations, like:
Nginx/Apache web server, or even creating an Express application from zero.well-known/acme-challenge/xxxxxxxx challengeYou can point your IP/host to this app, and he'll retrieve what you pass through environment variables. Simple as that.
This code has an public image available in Docker Hub, with the runtime size of only ~88mb. Feel free to use this anywhere you like. 😎
docker pull simstosh/web-request-simulator
docker run --rm --name web-request -e RESPONSE="<b>Hello World</b>" simstosh/web-request-simulator
To install dependencies:
bun install
To run the project:
RESPONSE="content to retrieve" bun run dev
Environment variables available to use:
# This env var will be the body of the response. What you provide here, it'll return as response
RESPONSE="<b>Hello world!</b>"
# The port used by the app
PORT=3000
# The content-type of your response. If you don't provide anything, the default will be "text/html"
CONTENT_TYPE="text/html"
Content type
Image
Digest
sha256:1ae525aef…
Size
87.2 MB
Last updated
about 3 years ago
docker pull simstosh/web-request-simulator