0.2.1 • Published 4 months ago

@head/edge v0.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

@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

0.2.1

4 months ago

0.2.0

4 months ago

0.1.1

2 years ago

0.1.0

2 years ago