
Product
Go Support Is Now Generally Available
Socket's Go support is now generally available, bringing automatic scanning and deep code analysis to all users with Go projects.
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",
"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
The npm package mvcjs receives a total of 30 weekly downloads. As such, mvcjs popularity was classified as not popular.
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.
Product
Socket's Go support is now generally available, bringing automatic scanning and deep code analysis to all users with Go projects.
Security News
vlt adds real-time security selectors powered by Socket, enabling developers to query and analyze package risks directly in their dependency graph.
Security News
CISA extended MITRE’s CVE contract by 11 months, avoiding a shutdown but leaving long-term governance and coordination issues unresolved.