Socket
Socket
Sign inDemoInstall

crixalis

Package Overview
Dependencies
10
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    crixalis

Lightweight web framework


Version published
Weekly downloads
18
decreased by-71.87%
Maintainers
1
Install size
406 kB
Created
Weekly downloads
 

Changelog

Source

1.0.0

Released 2016-10-05

Core

  • Refactored core classes
  • .define() no longer needs definition type
  • .define() can declare views and features
  • .define() can not attach event listeners anymore
  • .has() can be used to test for implemented features
  • Implemented direct route declaration using .route()
  • Implemented instance isolation
  • Implemented feature declaration
  • Implemented view declaration
  • Implemented * support for routes
  • Implemented auto view
  • Implemented Accept-based response for default error handler
  • Removed deprecated code
  • Removed .router()
  • Removed syncronous routes and .async flag
  • Removed default event
  • Removed route hashMap, all routes now are compiled to RegExp
  • Removed ._routes, ._patterns and ._views
  • Removed .is_get() and others
  • Removed .chain()
  • Removed .view property and all views except auto
  • Renamed ._response() to .sendResponse()
  • Renamed ._destroy() to .destroyContext()
  • Renamed ._handler() to .createContext()
  • Renamed Context.start to Context.stamp (conflict with .start())
  • Fixed Content-Type-based routes
  • Fixed :placeholder RegExp to not accept dots

Plugins

  • Implemented ETag support for static plugin
  • Removed plugins for content translation (coffee, less, jade)
  • Compression plugin declares feature::compression when loaded
  • Static plugin declares feature::static when loaded
  • Static plugin has more obvious default properties
  • Shortcuts plugin lost .any() method

Readme

Source

Crixalis

Lightweight web framework for node.js

Features

  • Small, documented and easily extendable core
  • Advanced routing system (content type, method, host) with RegExp support and placeholders
  • Compression support (gzip, deflate)
  • Static file serving support (with ETag, Last-Modified, Expires and LRU-cache)

Synopsis

General usage


var Crixalis = require('crixalis');

Crixalis

	/* Load plugins */
	.plugin('shortcuts')
	.plugin('access', { format: '%7T %-4m %s %9B %-15h %U%q' })

	/* Add route with placeholder */
	.get('/hello/:name', function () {
		/* Prepare data for response */
		this.stash.json = {
			message: 'Hello, ' + this.params.name + '!'
		};

		/* Render response */
		this.render();
	})

	/* Add another route for GET and HEAD methods */
	.route('/info', { methods: ['GET', 'HEAD'] }, function () {
		var that = this;

		require('fs').readFile('./readme.md', function (error, result) {
			if (error) {
				/* Handle error */
				that.error(error);
			} else {
				that.body = result;
				that.render();
			}
		});
	})

	/* Catch everything else */
	.route('*', function () {
		this.redirect('/hello/World');
	})

	/* Start server on port 8080 */
	.start('http', 8080);

Plugins

Available core plugins

  • access Access log (with configurable CLF support)
  • compression Compress response using gzip or deflate compression (also works with static plugin)
  • request Thin wrapper around http.request and https.request
  • shortcuts Route declaration helpers, .get(), .post(), etc.
  • static Serve static files

Static server

Crixalis comes with script for serving static files

	# Start web server on port `8080` and serve files from current folder
	crixalis

	# Start web server on port `3000` and serve files from `~/www/`
	crixalis --port 3000 --path ~/www/

Copyright 2012-2016 Alexander Nazarov. All rights reserved.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Keywords

FAQs

Last updated on 05 Oct 2016

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc