0.3.1 • Published 4 years ago

kai-api v0.3.1

Weekly downloads
26
License
ISC
Repository
github
Last release
4 years ago

0.3.1 release

Online Api - Now you can use the test-api online, Not only use in localhost by use ngrok automatically.

Fix - use new ngrok version 4.1.0

Installation

npm install kai-api --save

quickly start

For front-end to test or practice CRUD api in localhost.

var apiTestServer = require('kai-api');

apiTestServer(5151)

Now when you use http://localhost:5151/ or NGROK_ONLINE_URL , you will get it.

GET http://localhost:5151/

Example response

[
  {
    "message": "Good01",
    "detail": "test-get-api-01",
    "imgURL": "http://californiacommunitycolleges.cccco.edu/Portals/0/logos/ccc_logo_no_text_bw.jpg"
  },
  {
    "message": "Good02",
    "detail": "test-get-api-02",
    "imgURL": "http://geotypografika.com/wp-content/uploads/2009/01/8851-500-500.jpg"
  },
  {
    "message": "Good03",
    "detail": "test-get-api-03",
    "imgURL": "https://dspncdn.com/a1/media/692x/22/c7/39/22c73916a6aaa2672e7d85a386911e61.jpg"
  },
  {
    "message": "Good04",
    "detail": "test-get-api-04",
    "imgURL": "http://zenefashion.com/wp-content/uploads/2016/08/500-500-88.jpg"
  },
  {
    "message": "Good05",
    "detail": "test-get-api-05",
    "imgURL": "https://www.noao.edu/image_gallery/images/d3/ngc3582-500.jpg"
  },
  {
    "message": "Good06",
    "detail": "test-get-api-06",
    "imgURL": "https://upload.wikimedia.org/wikipedia/en/thumb/1/16/Kaizer_Chiefs_logo.svg/500px-Kaizer_Chiefs_logo.svg.png"
  }
]

PUT http://localhost:5151/

Example response

{message:'update success'}

POST http://localhost:5151/

Example response

{message:'post success'}

DELETE http://localhost:5151/

Example response

{message:'delete success'}

custom get json

var apiTestServer = require('kai-api');

apiTestServer(5151,
  [
    {
      "name": "kevin",
      "phone": "0911111111",
    },
    {
      "name": "mary",
      "phone": "0922222222",
    }
  ]
)

GET http://localhost:5151/

Example response

[
  {
    "name": "kevin",
    "phone": "0911111111",
  },
  {
    "name": "mary",
    "phone": "0922222222",
  }
]

default port

var apiTestServer = require('kai-api');

apiTestServer()

You will listen port on 8080.

0.3.1

4 years ago

0.2.4

4 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.1.9

7 years ago

0.1.8

8 years ago

0.1.7

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.11

8 years ago

0.0.10

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago