ReBase
Documentation



ReBase Documenation

Welcome to the ReBase framework documentation. Here is a simple hello world example to get started:

mkdir my-project
cd my-project
npm i -S @rebase-framework

Create a rebase-manifest.json file:


{
  "type": "rebase-worker",
  "name": "my-project",
  "version": "1.0.0",
  "license": "017311ed944f32ff243ee137a31dbf2272c312f65e15b2593f85a0334046704f",
  "logging": {
    "verbosityLevel": 3
  },
  "expose": {
    "routesHttp": 8080,
    "apiHttp": 8080
  },
  "routes": {
    "/hello-world": "src/hello-world-http.mjs"
  },
  "api": {
    "hello.wordl": "src/hello-world-api.mjs"
  }
}

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

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

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

export default async (req, res, worker) => {
  res.json({
    succcessfull: true,
    hello: 'world!'
  })
}