@head/edge
v0.3.0
Published
@head/edge
Downloads
5
Readme
@head/edge
// service.js
import Application from '@head/edge';
import $rpc from '/path/to/user-rpc';
const { router, client } = new Application();
router.verb('GET', '/api/users', async (ctx, next) => {
const data = await $rpc.doPost('/path-to/userService');
ctx.body = data;
next();
});
export default client;
// store.js
import $client from './service';
async function init() {
const data = await $client.get('/api/users');
state.users = data;
}