// 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;
}
-
Notifications
You must be signed in to change notification settings - Fork 1
head-js/edge
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
@head/edge,koa for browser side