partial.js logo
Latest version
v1.3.1 (RC2)

Welcome in partial.js documentation

Free web application framework for building Web sites and Web applications using JavaScript, HTML and CSS.

Thank you for interesting of partial.js - web application framework for node.js. I'm improving the quality and grammar of this documentation. I'm working on LTS (long time support) version.

Download partial.js:

On current page:

How does partial.js work?


partial.js is web application framework for node.js. If you understand functions of framework then you will love it. Framework has very simple logic and many features for creating rich web application.



Framework


Install framework - partial.js

$ cd yourwebsitedirectory
$ npm install partial.js

Or download empty-project (120 kB).


How to run framework?

HTTP

var framework = require('partial.js');
var http = require('http');

var port = 8000;
var debug = true;

framework.run(http, debug, port, '127.0.0.1');

if (debug)
	console.log("http://{0}:{1}/".format(framework.ip, framework.port));

HTTPS

var framework = require('partial.js');
var https = require('https');
var fs = require('fs');

var options = {
	key: fs.readFileSync('path-to-key.pem'),
	cert: fs.readFileSync('path-to-cert.pem')
};

var port = 8000;
var debug = true;

framework.run(http, debug, port, '127.0.0.1', options);

if (debug)
	console.log("http://{0}:{1}/".format(framework.ip, framework.port));


How is the framework initialized?



Website testing on the internet (tunnel between localhost and internet)

Homepage: ngrok - secure introspectable tunnels to localhost
Documentation: ngrok - documentation

Ngrok creates a tunnel from the public internet (http://subdomain.ngrok.com) to a port on your local machine. You can give this URL to anyone to allow them to try out a web site you're developing without doing any deployment.

ngrok and partial.js

NGROK RUN

NGROK IS RUNNING

NGROK RESULT

Publish a website - REVERSE PROXY


node.js / partial.js reverse proxy

Reverse proxy through ...

Deploy a website to AppFog


NGINX reverse proxy - EDIT: nginx.conf

worker_processes  1;

events {
    worker_connections  1024;
}

http {

    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    server {
        listen      80;
        server_name www.partialjs.com;
        server_name partialjs.com;
        charset     utf-8;

        location @proxy {
            proxy_set_header   Host             $http_host;
            proxy_set_header   X-Forwarded-For  $remote_addr;
            proxy_set_header   X-NginX-Proxy    true;
            proxy_pass         http://127.0.0.1:8000;
            proxy_redirect     off;
            break;
        }

        location / {
            try_files $uri.html $uri $uri/ @proxy;
        }

        location ~ /. {
            access_log    off;
            log_not_found off;
            deny all;
        }

        # WEBSOCKET DEFINITION

        # location /websocket/ {
        #     proxy_pass http://127.0.0.1:8000;
        #     proxy_http_version 1.1;
        #     proxy_set_header Host             $http_host;
        #     proxy_set_header X-Forwarded-For  $remote_addr;
        #     proxy_set_header X-NginX-Proxy    true;
        #     proxy_set_header Upgrade          $http_upgrade;
        #     proxy_set_header Connection       "upgrade";
        # }
    }

    server {
        listen      80;
        server_name docs.partialjs.com;
        charset     utf-8;

        location @proxy {
            proxy_set_header   Host             $http_host;
            proxy_set_header   X-Forwarded-For  $remote_addr;
            proxy_set_header   X-NginX-Proxy    true;
            proxy_pass         http://127.0.0.1:8001;
            proxy_redirect     off;
            break;
        }

        location / {
            try_files $uri.html $uri $uri/ @proxy;
        }

        location ~ /. {
            access_log    off;
            log_not_found off;
            deny all;
        }
    }
}

Download node.js Sublime Text Build System

Sublime Build System

Sublime User packages

Download and unzip to /user/: nodejs.sublime-build.zip

Download Sublime Text 2 syntax


Download syntax (4.9 kB)
Download the file, unpack and read readme.txt
partial.js syntax for Sublime TExt 2 editor