0.1.5 • Published 8 months ago

@rebase.framework/worker v0.1.5

Weekly downloads
-
License
source available,...
Repository
-
Last release
8 months ago

Rebase-Framework Worker

This is the required runtime to run rebase-worker instances as defined in the documentation here

To use this runtime, create a rebase-manifest.json file in your project. Give it some basic features like this:

{
  "type": "worker",
  "name": "my-project",
  "license": "....",
  "logging": {
    "verbosityLevel": 3
  },
  "expose": {
    "routesHttp": 8080
  },
  "routes": {
    "/hello-world": "src/hello-world-http.mjs"
  }
}

Create a src/hello-world-http.mjs file:

export default async (req, res, worker) => {
  return `
    <html>
      <body>Hello World!</body>
    </html>
  `
}

Then start the worker from the directory where the manifest file is located:

cp my-project/
npx rebase-run start

From this point on, you can checkout the documentation about all the extension modules to have most of the features, that a projects sooner or later needs, setup out of the box only requiring your business logic.

Local documentation

There is also a local copy of the documentation available from the documentation directory. You can use npm run documentation to serve the documentation locally on port 8080.

Supported NodeJS Versions

Currently only NodeJS version v20.18.1 is supported on windows and linux.