1.0.11 • Published 6 years ago

convert-slow-api v1.0.11

Weekly downloads
27
License
ISC
Repository
github
Last release
6 years ago

covert slow api

covert slow api to a set of quick ones

how

old path

post /process {data:xx}

new path

post /start-process

get /is-it-done
get /is-it-done
get /is-it-done
...

usage

server side

const express = require('express')
const getRouter = require('convert-slow-api/dist/get-router').default

const app = express()
app.use('/api',getRouter(async ({greeting})=>await fn(greeting)))

client side

const fetcher = require('convert-slow-api/dist/fetcher').default
  ;
(async () => {
  let result = await fetcher("http://localhost:3000/api", {
    greeting: 'hi josh',
  })
  console.log(result)
})()
1.0.11

6 years ago

1.0.9

6 years ago

1.0.10

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago