JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 201
  • Score
    100M100P100Q104513F
  • License MIT

A add-on for running tsoa on cloudflare workers

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tsoa-workers) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    tsoa-workers

    This is a lib is to make it possible to run the fantastic TSOA-library in Cloudflare workers.

    To avoid any node dependencies ensure that you import @tsoa/runtime in your routes rather than tsoa

    After a bit of misunderstanding the only thing needed to add is to a new handlebars-template.

    Examples

    Check out the examples folder for how to set up a project using tsoa-workers. The only change needed compared to vanilla tsoa is just a single line in the tsoa.json-file to switch the middleware template:

    {
      "entryFile": "src/app.ts",
      "noImplicitAdditionalProperties": "throw-on-extras",
      "controllerPathGlobs": ["src/**/*Controller.ts"],
      "spec": {
        "outputDirectory": "build",
        "specVersion": 3,
      },
      "routes": {
        "routesDir": "build",
        "middlewareTemplate": "node_modules/tsoa-workers/cloudworker-router.hbs"
    
      }
    }