
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
express-play
Advanced tools
Express based MVC Framework for Node.js
This project is under construction. Don't use it yet.
The default file structure and the entry file of an express-play application:
/app
/controllers - controllers root directory
/contents - controllers sub directory
articles.js - articles controller (/contents/articles/... auto-loaded)
accounts.js - account controller (/accounts/... auto-loaded)
home.js - home controller (/home/... auto-loaded)
/lib - modules root directory
logger.js - logger module (auto-loaded and auto-injected)
repository.js - repository module (auto-loaded and auto-injected)
server.js
// server.js
// Super simple, isn't it?
require('express-play').play(3000);
The framework maps resource handler routings automatically using the object graph, function names and 'id' parameter that is special in express-play.
// /app/controllers/contents/articles.js
function ArticlesController() {
// GET /contents/articles
// GET /contents/articles/:id
this.get = function (id) {
};
// POST /contents/articles
this.post = function () {
};
this.comments = {
// GET /contents/articles/comments
// GET /contents/articles/comments/:id
get: function (id) {
},
// POST /contents/articles/comments
post: function () {
}
};
// GET /contents/articles/top
this.top = function () {
};
}
module.exports = ArticlesController;
Query values are injected to the handler function as parameters automatically. The order of parameters is not important.
// /app/controllers/contents/articles.js
function ArticlesController() {
// GET /contents/articles/top?by=[by]&count=[count]
this.top = function (by, count) {
by = by || 'likes';
count = count || 10;
};
}
module.exports = ArticlesController;
An object module:
// /app/lib/logger.js
function Logger() {
}
// The module name is 'logger' that is inferred from the file name.
module.exports = new Logger();
A constructor module:
// app/lib/repository.js
function Repository() {
}
// The module name is 'Repository' that is the constructor function name.
module.exports = Repository;
// /app/controllers/contents/articles.js
function ArticlesController(logger) {
// 'logger' is injected to this controller once.
this.logger = logger;
}
module.exports = ArticlesController;
// /app/controllers/contents/articles.js
function ArticlesController() {
// GET /contents/articles/top
this.top = function (Repository) {
// A new instance of 'Repository' is injected to this function everytime the handler is called.
var repo = Repository;
};
}
module.exports = ArticlesController;
The MIT License (MIT)
Copyright (c) 2014 Yi Gyuwon gyuwon@live.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
This project is under construction. Don't use it yet.
The npm package express-play receives a total of 1 weekly downloads. As such, express-play popularity was classified as not popular.
We found that express-play 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
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.