@head/edge

0.2.1 • 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;
}

delegates @1.0.0 / 2015-12-14

path-to-regexp @6.2.1 / 2022-05-07

Koa Compose @4.1.0 / 2018-05-22

Koa @2.13.4 / 2021-10-19

Koa Router @11.0.1 / 2022-07-04

Readme

Keywords

none

Package Sidebar

Install

npm i @head/edge

Weekly Downloads

0

Version

0.2.1

License

MIT

Unpacked Size

180 kB

Total Files

13

Last publish

Collaborators

  • hbrls