swizzy-swerve is a bootstrapper for swizzy web services. This package will bootstrap and run independent swizzy web services.
https://swizzyweb.github.io/swerve-manager/
swerve: synonym for swerven
swerven: swerve with nodejs
swerveb: swerve with bun
swerved: swerve with deno
swervenc: swerve with node clustered
swervebc: swerve with bun clustered
swervedc: swervice with deno clustered.
npm run server
npm install -g .
npm uninstall -g @swizzyweb/swerve
swerve
Swerve can run multiple packages on the same port using a single command. Just provide multiple package names space separated.
swerve <service> [seriveB serivceC...] [options]
swervec <service> [--numThreads (optional)] [options]
Note: cluster commands end with c
--port : (default 3005) port value to run service
--appDataRoot - (default project root) path to where appdata root directory will be placed, stores logs and service data
--numThreads - (default num cpu's reported by os) (cluster only) number of threads to use in the cluster
--<argKey> - Any additional key passed will be a serviceArg passed to all services
swerve some-service-name --port=3000
This will run the project in the current working directory
swerve
This will run the server in the current directory with the specified port
swerve .
swerve . --port 3000
swerve /path/to/file.js
swerve /absolute/path/to/app.js
or
swerve $(pwd)/dist/app.js
We support bun deno and nodejs for runtimes
swerven # node
swerveb # bun
swerved # deno
swerven # default (points to swerven as of 0.2.4)
to run a cluster of your swerve services, you can use the cluster scripts. These are implemented in nodejs, bun, and deno.
swervec
swerven
swervebc
servedc
{
packageName: string,
port: number,
app: expressApp,
logger: ILogger,
appDataPath: "/appDataRoot/appdata/serviceName/"
...serviceArgs // Anything else (from service config or swerve command args)
}
{
"port": 3000, // Global port
"services": {
"friendlyLocalServiceName": {
"port": 3001, // Optional port override
"servicePath": ".", // if building package in current directory
"myArg1": "AnythingYouWant" // Custom serviceArg
},
"friendlyImportServiceName": {
"port": 3002,
"packageName": "@swizzyweb/dyn-serve-web-service" // running installed web service package
},
"friendlyNeighborServiceName": {
"port": 3002,
"servicePath": "../my-friendly-neighbor-web-service",
"authCode": "SomeAuthCode"
}
}
}
swerve --config my-web-service-config.json
npx typedoc