0.1.1 • Published 5 years ago
@webserverless/cli v0.1.1
WebServerless
Serverless based web development framework.
Getting Started
npm install @webserverless/cli@next -g
webserverless init demo # init template
npm install -g yarn # install yarn tool
yarn build # build project
yarn start:backend # start local backend for frontend
yarn start:frontend # start loacl frontend
yarn deploy # deploy project to cloud, need to configure AK with yarn config
Defining interface
// src/common/hello-world-protocol.ts
export const HelloWorldServer = Symbol('HelloWorldServer');
export interface HelloWorldServer {
say(): Promise<string>;
}
Defining server
// src/node/hello-world-server.ts
import { rpc } from '@webserverless/core/lib/common/annotation';
import { HelloWorldServer } from '../common/hello-world-protocol';
@rpc(HelloWorldServer)
export class HelloWorldServerImpl implements HelloWorldServer {
say(): Promise<string> {
return Promise.resolve('Hello world.');
}
}
Binding server
// src/node/demo-backend-module.ts
export { HelloWorldServerImpl } from './hello-world-server';
import { buildProviderModule } from 'inversify-binding-decorators';
export default buildProviderModule()
Using client proxy
// src/browser/hello-world-service.ts
import { rpcInject, component } from '@webserverless/core/lib/common/annotation';
import { HelloWorldServer } from "../common/hello-world-protocol";
@component(HelloWorldService)
export class HelloWorldService {
constructor(
@rpcInject(HelloWorldServer) protected readonly helloWorldServer: HelloWorldServer
) {}
}
Binding service
// src/browser/demo-frontend-module.ts
export { HelloWorldService } from './hello-world-service';
import { buildProviderModule } from 'inversify-binding-decorators';
export default buildProviderModule()
0.2.0-next.7727fd75
5 years ago
0.1.1
5 years ago
0.2.0-next.7cf6b529
5 years ago
0.1.0
5 years ago
0.1.0-next.4f8cdfe7
5 years ago
0.1.0-next.fbe82e93
5 years ago
0.1.0-next.3ba46137
5 years ago
0.0.8
5 years ago
0.1.0-next.1a7e6047
5 years ago
0.0.7
5 years ago
0.1.0-next.90431502
5 years ago
0.0.6
5 years ago
0.1.0-next.f2ef73bf
5 years ago
0.0.5
5 years ago
0.1.0-next.c04627fa
5 years ago
0.1.0-next.92b9aa61
5 years ago
0.0.4
5 years ago
0.1.0-next.ed155677
5 years ago
0.1.0-next.380d9539
5 years ago
0.1.0-next.b92a70fb
5 years ago
0.0.3
5 years ago
0.1.0-next.ae8a01df
5 years ago
0.1.0-next.1528e595
5 years ago
0.1.0-next.618339a3
5 years ago
0.1.0-next.185f1215
5 years ago
0.0.2
5 years ago
0.1.0-next.ef07695b
5 years ago
0.1.0-next.d4e6f2b6
5 years ago
0.1.0-next.6d2dd86d
5 years ago
0.1.0-next.9abaa450
5 years ago
0.1.0-next.e6cb256b
5 years ago
0.1.0-next.10a74b90
5 years ago
0.1.0-next.c2c78fb2
5 years ago
0.0.1
5 years ago
0.1.0-next.496c7306
5 years ago
0.1.0-next.b7aa8011
5 years ago
0.1.0-next.fde146e8
5 years ago
0.1.0-next.d19a57b3
5 years ago
0.1.0-next.92ee87ff
5 years ago
0.1.0-next.044d57f7
5 years ago
0.1.0-next.cfe4ef84
5 years ago