Get unlimited public & private packages + package-based permissions with npm Pro.Get started »

perseus

0.0.6 • Public • Published

Perseus

A micro-framework for Node.js named after the destroyer of Medusa who was conceived in the golden showers of Zeus himself.

To install:

npm install perseus

To create an app:

var perseus = require('perseus');
 
perseus.view = 'views'; //Template directory
perseus.public = 'public'; //Public assets directory
 
perseus.get('/', function(req, res) {
  perseus.make("index.html", { name: "Andromeda" });
});
 
perseus.post('/', function(req, res) {
  console.log(req.query); //req.query contains parsed querystring
});
 
perseus.listen(); //Defaults to 3000

What it does so far:

  • Handles GET and POST requests
  • To send plain text - perseus.send('Hello world!');
  • To render template - perseus.make('index', object);
  • Utilizes nunjucks templating engine - read documentation here
  • To set template folder (optional: defaults to views folder in root of web directory) - perseus.view ='directoryName'
  • To set public folder (optional: defaults to public folder in root of web directory) - perseus.public = 'directoryName'

Keywords

none

Install

npm i perseus

DownloadsWeekly Downloads

10

Version

0.0.6

License

none

Last publish

Collaborators

  • avatar