
Security News
ESLint Adds Official Support for Linting HTML
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Expressway is an extensible, MEAN microframework for Node.js, designed to be completely modular. It is heavily influenced by Taylor Otwell's Laravel for PHP and Google's front-end framework, AngularJS.
npm install breachofmind/expressway --save
# Or, for cool kids:
yarn add breachofmind/expressway
src
, some like lib
.
Expressway is designed to be agnostic to your application's structure.Quite possibly the most useful feature is Expressway's IOC implementation, which is borrowed almost exactly from AngularJS.
app.call(function)
.app.service('profit', "No more require()!");
function myFunction(profit) {
return profit;
}
app.call(myFunction); // "No more require()"!
This is a very simple example. Imagine how useful this is when it's available in your controller routes:
class MyController extends expressway.Controller
{
/**
* MyController.index route.
* GET /
*/
index(request,response,next,profit) {
return profit;
}
}
Services can be anything - strings, functions, objects, etc.
If you just want to get started with a sensible structure, the Expressway Yeoman generator is the way to go.
npm install breachofmind/expressway-generator -g
mkdir myApp && cd myApp
yo expressway myApp
npm install breachofmind/expressway.
// expressway.js
var expressway = require('expressway');
var app = expressway({
rootPath: __dirname,
});
// Add some services.
function motivationalQuote() {
return `A nation that separates it's warriors from
its scholars will have its fighting done by fools
and its thinking done by cowards.`;
}
app.service(motivationalQuote);
// Expressway apps have a "root" app.
// Any extensions you might add later are mounted to this root app.
app.root.routes = [
{
// Routes are added in a declarative manner.
"GET /" : function(request,response,next) {
return response.send("Hello World");
},
// Anonymous routes allow for dependency injection.
"GET /quote" : function(request,response,next,motivationalQuote) {
return response.send( motivationalQuote() );
},
// As your app gets bigger, you might want to add a controller.
"GET /:model" : "ModelController.fetchAll",
// You may want to stack middleware on a route.
"POST /:model/:id" : [
// The name of a middleware to pass through.
"ModelRequest",
// An anonymous middleware.
function(request,response,next) {
console.log('middleware test');
next();
},
// Add finally, the controller method I wanted.
"ModelController.save"
]
},
// A simple "NotFound" middleware in case nothing is matched.
'NotFound'
];
// Start the server.
app.start();
node expressway.js
The Wiki is where it's at.
I'll be adding more documentation very soon as the API smooths out.
mocha test
FAQs
A modular MVC microframework for Node.js Express and your impatience
The npm package expressway receives a total of 8 weekly downloads. As such, expressway popularity was classified as not popular.
We found that expressway demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.