0.1.0 • Published 9 years ago
xepler v0.1.0
Xepler is a lightweight web framework made in Italy for Node.js
It allows to easily build your website, only focusing on the app code.
It's modulable, MVC-driven and without dependencies. It comes with the middlewares and features you need, at an awesome speed.
Install
$ npm install xepler
or download it directly from here.
Features
- Advanced URL routing
- HTTPS and Subdomains
- Sessions (with support to memory, files, memcached and redis)
- Cookies, flash messages and POST data parsing
- Templating engine with precompilation cache
- Cache and compression management
- Static assets and favicon middlewares
- Localization
- Form validation/sanitization, CSRF, clickjacking and security module
- HTTP Basic Authentication
Very simple working website
var app = require("xepler")();
app.queueAll.push( app.modules.router(app) );
app.start();
This allows the server to listen HTTP requestes on the default port 80. You can test this, navigating from your web browser to "localhost/". If all is going fine, it should show the "404 Not Found" page.
The next step is to create under the folder "views/" an "index.html" file with some content to enjoy your first website page!
Example with the template and dynamic params
var app = require("xepler")();
app.queueAll.push( app.modules.router(app) );
//route a URL like /users/josh/photo, rendering the view
app.route('/users/:name/photo', function($) {
$.render('/users/viewUserPhotos', {
"name" : $.params.name
});
});
app.start();
Add the middlewares for all the features
app.queueAll.push( app.modules.favicon() );
app.queueAll.push( app.modules.cookiesParser() );
app.queueAll.push( app.modules.localization(app) );
app.queueAll.push( app.modules.bodyParser() );
app.queueAll.push( app.modules.sessions.load(app) );
app.queueAll.push( app.modules.csrf() );
app.queueAll.push( app.modules.router(app) );
app.queueAll.push( app.modules.sessions.save(app) );
app.queueAll.push( app.modules.static(app) );
Collaboration
Feel free to collaborate sending pull requests (and update the tests)
License
MIT