1.1.3 • Published 4 years ago

node-api-framework-lc v1.1.3

Weekly downloads
25
License
MIT
Repository
github
Last release
4 years ago

Node Api Framework

Example server.js

const Config = require('node-libs-lc').Config;
const ApiServer = require('./src/ApiServer');
const EnvUtils = require('node-utils-lc').EnvUtils;
const path = require('path');
const basePath = __dirname;

Config.create(path.join(basePath, 'config'), EnvUtils.ENV_TYPES).then((config) => {
  const server = new ApiServer(basePath, config);
  server.lift().then(() => {
    // Ready
  });
});

Example app.json

{
  "paths": {
    "controller": "src/mvc/controller/",
    "middleware": "src/mvc/middleware/"
  },
  "server": {
    "port": 8080,
    "logger": {
      "config": {
        "level": "DEBUG",
        "mode": "CONSOLE",
        "file": "access.log"
      }
    }
  },
  "logger": {
    "level": "DEBUG",
    "mode": "CONSOLE",
    "file": "app.log"
  }
}

Example routes.json

[
  {
    "path": "/test",
    "action": "TestController@test",
    "method": "get",
    "validate": {
      "query": {
        "username": {
          "required": [true],
          "min": [8]
        }
      },
      "body": {
        "username": {
          "required": [true],
          "min": [8]
        }
      }
    }
  }
]
1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.0.15

5 years ago

0.0.14

5 years ago

0.0.13

5 years ago

0.0.10

5 years ago

0.0.11

5 years ago

0.0.12

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago