1.0.11 • Published 4 years ago

convert-slow-api v1.0.11

Weekly downloads
27
License
ISC
Repository
github
Last release
4 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

4 years ago

1.0.9

4 years ago

1.0.10

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago