+
Skip to content

oxyflour/kyk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kyoko

Write grpc microservices in typescript. Just for fun, Don't use.

Note: Installing grpc over proxy may fail beacuse of needle issue. Add the following line to your .npmrc file

grpc_node_binary_host_mirror=https://npm.taobao.org/mirrors

Example

api.ts

// define your async functions as service here, a default keyword is required
export default {
    async hello() {
        // you can use `this` to reference other async functions
        return 'my ' + await this.faas.server()
    },
    faas: {
        // async functions within objects are supported
        async server() {
            return 'FAAS'
        },
    },
    async *stream() {
        for (let i = 0; i < 10; i ++) {
            await new Promise(resolve => setTimeout(resolve, 100))
            yield i
        }
    },
}

server

kyk serve api.ts
# outputs: grpc server started at 0.0.0.0:5000

client

kyk call http://localhost:5000/hello
# outputs: my FAAS

License

MIT

About

simple and stupid FAAS service mesh

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载