GitXplorerGitXplorer
j

fast-restapi2

public
0 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
c11aa5bfcb90a753c5c3ac5ded28b1e844cdfd6b

Better form parsing

committed 2 months ago
Unverified
3a45061eb15d38f990ddc574d3c664f05e44e083

formidable update, loosen valid file names

jj-o-r committed 9 months ago
Unverified
045d4e59e79c670a48da1dde658e012dcc2084fb

Fixes timestamp modified in folder indexes

jj-o-r committed 2 years ago
Unverified
6467625b5fcefd60c899dd60e67c8c14acee8915

ignore flowdump report.xml

jj-o-r committed 2 years ago
Unverified
01ea672e8ae983d02f16c2eb4ff6b36f68cf32b2

Server a whole folder including the data from files in it

jj-o-r committed 2 years ago
Unverified
30da7bff5c1322dce3d1feb6cb911b38b8943e21

Removed log

jj-o-r committed 2 years ago

README

The README file for this repository.

fast-restapi 2

Fast http api server

module type es6 ready

npm install --save fast-restapi2
import server from 'fast-restapi2';

class TestController {

  /**
   * index
   *
   * @static
   * @param  {import('../node_modules/fast-restapi2/lib/ClientWrapper.js').default} client - Client request, response wrapper.
   * @param {Array} params - url parts as strings
   */
  static index(client,params){
    // http://127.0.0.1:9022/api/index
    client.serve(200,{'joe':['bar']});
  };
  /**
   * visitme
   *
   * @static
   * @param  {import('../node_modules/fast-restapi2/lib/ClientWrapper.js').default} client - Client request, response wrapper.
   * @param {Array} params - url parts as strings
   */
  static visitme(client,params){
    // http://127.0.0.1:9022/api/visitme/param1/param2
    client.serve(200,{params:params});
  };
}

server.create('api',{port:9022,host:'127.0.0.1'},TestController).then((res){
  console.log(res)
}).catch((error) => {
  console.error(error);
});

process.stdin.resume();