mdkcontroller
v1.6.2
Published
Quick setup authentication and express
Readme
Installation
This is a Node.js module available through the
npm registry. Installation is done using the
npm install command:
$ npm i mdkcontrollerAPI
import {Root} from "mdkcontroller";Examples
This is a library that helps build websites faster, but at the basic level it supports api, socketio, login, DKTable and some files available in cores.
// import {Root} from "./index.js";
import {Router} from "express";
import {Root} from "mdkcontroller";
const cfg = {
redirectHome: function (req, res) {
// Path in current project
res.redirect("/pages");
}
// ,trySkipAuth: function (req, res, next) {
// if (true) {
// next();
// }
// return true;
// }
}
//global.allowRegister = true;
const _sv = await Root("khanhnbd", cfg);
_sv.startListen(8095);You can test this out with the cURL program:
curl -I -H'Accept: text/html' http://localhost:8095/