0.1.0 • Published 9 years ago

xepler v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 years ago

Xepler

NPM version

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

0.1.0

9 years ago

1.0.0

10 years ago

1.5.0

10 years ago

1.6.0

10 years ago

1.4.0

11 years ago

1.3.1

11 years ago

1.3.0

11 years ago

1.2.3

11 years ago

1.2.2

11 years ago

1.2.1

11 years ago

1.2.0

11 years ago

1.1.1

11 years ago

1.1.0

11 years ago

1.0.3

11 years ago