Skip to content

AndrewSumin/FrontikJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IMPORTANT deep alpha, everything can be changed.

To use FrontikJS you need NodeJS 0.4.0 or above.
http://nodejs.org/

Install NodeJS, then checkout FrontikJS.
Copy config.js.ex to config.js and change port if you need.
> node lib/frontik.js
> curl "localhost:8080"
8080 if you don't change port in config file.
You should see "Hello world" html page.

If you want to run tests you need npm
http://npmjs.org/

And vows
http://vowsjs.org/



-----------------------------------------------

See test app to create your own application.
If you have several apps, write config.apps function.

Simple application

module.exports = function (handler, callback){
    callback({
        collect: function(callback){
            // some logic
            // must call callback() when ready;
        },
        transform: function(doc){
            // make response
            handler.response.writeHead(200, {'Content-Type': 'text/html; charset=utf-8'});
            handler.response.write('<!DOCTYPE html><head><html><title>FrontikJS</title></head><body>Hello!</body></html>');
            handler.response.end();
        }
    });
};

handler.http(url, [options], [callback]);

handler.file(path, [callback]);

handler.put(name, promise); // promise – handler.http || handler.file

About

Frontik on NodeJS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published