@head/edge

0.3.0 • Public • Published

@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;
}

/@head/edge/

    Package Sidebar

    Install

    npm i @head/edge

    Weekly Downloads

    2

    Version

    0.3.0

    License

    MIT

    Unpacked Size

    193 kB

    Total Files

    15

    Last publish

    Collaborators

    • hbrls