swizzy-swerve is a bootstrapper for swizzy web services. This package will bootstrap and run independent swizzy web services.
npm install @swizzyweb/swerveswizzy-swerve is a bootstrapper for swizzy web services. This package will bootstrap and run
independent swizzy web services.
```
npm install --registry=https://npm.swizzyweb.com @swizzyweb/swerve
#### Frontend template
https://github.com/swizzyweb/swizzy-frontend-template-web-service
#### Backend template
https://github.com/swizzyweb/swizzy-backend-template-web-service
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
`
``
swervec
Note: cluster commands end with c
#### options
`
--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
--
`
#### ie
`
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 .
`
#### with port:
`
swerve . --port 3000
`
`
swerve /path/to/file.js
`
#### ie:
`
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 (Requires deno to be installed globally)
DENO_ARGS="--allow-sys" swerved # deno with permissions args
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,
"servicePath": "@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