
Security News
High Salaries No Longer Enough to Attract Top Cybersecurity Talent
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
Powerful lightweight mvc framework for nodejs inspired by Yii
Mvcjs is a first nodejs framework which supports modules as bundles!
npm install mvcjs
index.js
var di = require('mvcjs');
var framework = di.load('bootstrap');
framework.setBasePath(__dirname);
framework.init('app/', 'env.json');
app/env.json
{
"aliases": [
{
"key": "assetsPath",
"value": "@{basePath}/assets"
}
],
"components": [
{
"name": "core/logger",
"enabled": true,
"write": true,
"publish": true,
"console": true,
"port": 9001,
"file": "server.log"
},
{
"name": "core/router",
"errorRoute": "core/error"
},
{
"name": "core/favicon",
"path": "@{basePath}/favicon.ico"
},
{
"name": "core/view",
"themes": "@{appPath}/themes/",
"views": "@{appPath}/views/",
"theme": "default",
"cache": true
},
{
"name": "core/assets",
"path": "@{basePath}/storage/",
"hook": "^\\/assets"
},
{
"name": "db/mongo",
"connection": "mongodb://localhost/testdb"
}
],
"config": "config-test.js",
"assetsPath": "@{assetsPath}",
"port": 9000
}
app/config-test.js
module.exports = function (componet, di) {
"use strict";
var viewLoader, router,
logger = componet.get('core/logger'),
loggerModel = di.load('@{modelsPath}/logger');
viewLoader = componet.get('core/view');
viewLoader.setTheme('home');
// bind logger hook
logger.addHook(loggerModel.save.bind(loggerModel));
router = componet.get('core/router');
router.add([
{
pattern: 'home/<action>',
route: 'home/<action>'
},
{
pattern: 'posts/<action:(create|update|delete)>',
route: 'posts/<action>',
method: ['GET', 'POST']
},
{
pattern: 'user/<id:(\\d+)>',
route: 'user/view'
}
]);
router.add({
pattern: '/',
route: 'home/index'
});
};
FAQs
Powerful lightweight mvc framework for nodejs
We found that mvcjs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
Product
Socket, the leader in open source security, is now available on Google Cloud Marketplace for simplified procurement and enhanced protection against supply chain attacks.
Security News
Corepack will be phased out from future Node.js releases following a TSC vote.