workshop/packages/http
2025-07-25 14:31:11 -07:00
..
src Clean up 2025-07-25 14:31:11 -07:00
package.json Clean up 2025-07-25 14:31:11 -07:00
README.md Clean up 2025-07-25 14:31:11 -07:00
tsconfig.json I went a little crazy 2025-07-11 13:05:50 -07:00

http

A proxy server that will start all subdomain servers and a proxy server to route requests to the correct subdomain based on the URL.

How to setup a subdomain server

  1. Create a new package in the packages directory.
  2. Add a subdomain:start script to the package.json file of the new package.
  3. Optionally add a subdomain:dev script for development (so you can add things like hot reloading).
  4. It uses the directory name of the package to serve the subdomain.

How to setup a cron job

In your package's package.json, add a script that starts with cron: followed by the cron schedule.

Every minute: `"cron:constantly": "your-script-goes-here"`
Every hour: `"cron:hourly": "your-script-goes-here"`
Every day: `"cron:daily": "your-script-goes-here"` // Runs at midnight
Every week: `"cron:weekly": "your-script-goes-here"` // Runs on Sunday
Every month: `"cron:monthly": "your-script-goes-here"` // Runs on the 1st

If you want to run a script at a specific time, you can use the following format:

ALL TIMES ARE IN UTC!!! ALL TIMES USE THE 24 HOUR FORMAT!!!

cron:hourly@0:25": "your-script-goes-here" // The hour is ignored
cron:daily@1:20": "your-script-goes-here" // This is at 1:20 AM UTC for 1:20 PM use 13:20
cron:weekly@12:00": "your-script-goes-here"
cron:monthly@13:00": "your-script-goes-here"

What happens if you have two scripts with the same cron schedule?

cron:daily": "your-script-goes-here"
cron:daily #comment": "your-script-goes-here" // Everything after # is ignored so you can use this to make cron jobs unique or more readable

You can view the cron job status at http://theworkshop.cc