// 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;
}
@head/edge
0.3.0 • Public • PublishedDependents (0)
Package Sidebar
Install
npm i @head/edge
Repository
Homepage
Weekly Downloads
2
Version
0.3.0
License
MIT
Unpacked Size
193 kB
Total Files
15