@cloudful/cloudful
cloudful is a more optimistic way of building services on fully managed cloud services (aka serverless)
Last updated 2 years ago by christopheranderson .
MIT · Original npm · Tarball · package.json
$ cnpm install @cloudful/cloudful 
SYNC missed versions from official npm registry.

cloudful

cloudful is a more optimistic way of building services on fully managed cloud services (aka serverless). The cloudful framework uses metadata backed types to generate all the information it needs to create services using fully managed cloud services, such as Azure Functions and Azure Cosmos DB. It is currently focused on Node.js and TypeScript/JavaScript developers. It uses some experimental features like system-metadata and @decorators.

import { Binding, FunctionHost, Fx, HttpTrigger, HttpTriggerBinding, IBinding, IFunctionConfig, } from "@cloudful/cloudful";

class MyFunc {
    private myhttp(context: Context, @HttpTrigger("req") req: any) {
        context.log("I'm an http function");
        context.done();
    }
}

const host: FunctionHost = new FunctionHost();
host.register(MyFunc);

export default host;

Getting started

See the (hello world sample)[./sample/hello] for a simple intro

  • package.json
{
  "dev-dependencies":{
    "@cloudful/cloudful":"*",
    "typescript":"*"
  },
  "build":"tsc && cloudful build ./lib"
}
  • tsconfig.json
{
  "compilerOptions": {
    "declaration": true,
    "module": "commonjs",
    "moduleResolution": "node",
    "noImplicitAny": true,
    "outDir": "./lib",
    "preserveConstEnums": true,
    "removeComments": true,
    "target": "es6",
    "sourceMap": true,
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true
  },
  "include": [
    "**/*.ts"
  ],
  "exclude": [
    "node_modules",
    "**/*-spec.ts"
  ]
}
  • ./index.ts
import { Binding, FunctionHost, Fx, HttpTrigger, HttpTriggerBinding, IBinding, IFunctionConfig, } from "@cloudful/cloudful";

class MyFunc {
    private myhttp(context: Context, @HttpTrigger("req") req: any) {
        context.log("I'm an http function");
        context.done();
    }

    @Fx({
        excluded: true,
        bindings: [{
            name: "item",
            type: "queueTrigger",
            direction: "in",
            connection: "AzureWebJobsStorage",
        }],
    })
    private foobar(context: Context) {
        context.log("foobar");
        context.done();
    }
}

const host: FunctionHost = new FunctionHost();
host.register(MyFunc);

export default host;

License

MIT

Current Tags

  • 0.0.1                                ...           latest (2 years ago)

1 Versions

  • 0.0.1                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 1
Dependencies (6)
Dev Dependencies (14)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |