Untitled-JS
Fast, experimental, minimalist web framework for node.
Installation
This is a Node.js module available through the npm registry.
Before installing, download and install Node.js. Node.js 0.10 or higher is required.
Installation is done using the
npm install
command:
$ npm install untitled-js
Follow our installing guide for more information.
Features
- Virtual routing
- Focus on rapid development
- MYSQL AutoQuery Generator (untitled-model)
- View system supporting 3+ template engines
- Middleware Support
- Session Support
- Content negotiation
- Executable for generating applications quickly
Docs & Community
Security Issues
If you discover a security vulnerability in untitled-js, please see Contact Us.
Quick Start
The quickest way to get started with untitled-js is to utilize the executable untitled-generator
to generate an application as shown below:
$ npm install -g untitled-generator
Create the app:
$ mkdir myFirstApp && cd myFirstApp$ untitled init
Install dependencies:
$ npm install
Start the server:
$ node app.js
Philosophy
The Untitled philosophy is to provide small, robust tooling for HTTP servers, making it a great solution for single page applications, web sites, hybrids, or public HTTP APIs.
Untitled does not force you to use any specific template engine. With support for over 3 template engines. you can quickly craft your perfect framework.
People
The original author of Untitled is [Harendra Chhekur & Pankaj Devesh]
Documentation
Create New Project
$ mkdir MyProject && cd MyProject$ npm init$ untitled init$ npm install
If there is error in any statement #
Creating Server
var untitled = ;untitledsettings = ;untitled;/** or * untitled.startServer();* or* untitled.startServer(port, host);* /
Run Server
$ node app.js
Funtions
Creating Page
$ touch HelloWorld.jss
open this file in any text editor
var untitled = ;var page = untitled; page{ return true;} page{ res;} moduleexports = get;
Handling Requests On Pages
- page.run = function(req,res){return true;}
- page.get = function(req,res){}
- page.post = function(req,res){}
page.run
This is a pre processing function, which invoked before any other function of page. It must return true or false. Further execution of page will continue iff it returns true.
example
page{ if1 + 1 == 2 return true; res; return false;}
page.get
This function accept get request.
example
page{ var value = reqGET; res; res; value = reqGET; res; res; value = reqGET'name'; res; res;}
page.post
This function accept post request.
example
page{ var value = reqPOST; res; res; value = reqPOST; res; res; value = reqPOST'name'; res; res;}
Rendering Templates
res; filename = '*.jade' || '*.ejs' || '*.html'; Ex:// res.render('template/error_log.jade',{title:error});
Redirect Url's
example
res;
Session Handling
Put value in session
req.session.put(key,value) example
reqsession;
Get value from session
req.session.get(key) example
var name = reqsession;
Url Management
In home directory of you project you'll find url.json
example
here left side you just have to write virtual path that you want to locate your original path defined on righ side
Static File Management
you can save your all static files inside the static folder, then it'll not gonna execute
Middlewares
you can define you own middlewares and save them in folder named middlewares or chage the directory in settings, in case you want
Security
if you want to restrict some files or directory to user access from browseryou can just simply add __ at the string of that file or directory example:__settings __indexhtml
Settings
var path = ;moduleexports = HOST:"127.0.0.1" // Default Host PORT:"3000" // Default Port DEBUG:true // Debugging Mode SESSION:true // Enabled Session DATABASE : default: host: "localhost" user: "root" password: "" database:"test" // Default Database Settings HOME_PAGE: 'template/index-1.jade' // Home Page MIDDLEWARES : 'middlewares/favicon' 'middlewares/check_user' 'middlewares/access_denied' // MIddlewares MODEL_DIR : path // Path of models STATIC_DIR : path // Path of static files BASE_DIR : path // Path of root directory ERROR_PAGE : 'template/error_log.jade' // Error Page TEMPLATES_DIR : path // Path of Template URL_REWRITE_FILE : path // Path of urls