1.1.3 • Published 3 years ago

node-api-framework-lc v1.1.3

Weekly downloads
25
License
MIT
Repository
github
Last release
3 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

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.15

4 years ago

0.0.14

4 years ago

0.0.13

4 years ago

0.0.10

4 years ago

0.0.11

4 years ago

0.0.12

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago