Skip to content

前端用更方便而友好的 fetch 请求 koa-functions-api

Notifications You must be signed in to change notification settings

all-in-js/fetch-functions-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

fetch-functions-api

简化前端通过 fetch 请求 koa-functions-api

后端需要通过 koa-functions-api 实现 /api/functions 接口

import Fetch from '@all-in-js/fetch-functions-api';

const $fetch = new Fetch('/api/functions');

// GET
$fetch('api/helloWorld', {});

// POST, 暂时只支持 json
$fetch.post('api/helloWorld', {});

// combine
$fetch.combine({
  'api/helloWorld': {},
  'api/whatelse': {}
});

About

前端用更方便而友好的 fetch 请求 koa-functions-api

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published