Skip to content

iopa-io/iopa-core

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

IOPA
IOPA Core

Build Status NPM limerun

NPM

About

The 160Kb bundle includes a full optimized bundle of the lightweight IOPA fabric.
It is a single javascript file with no dependencies.

Includes:

  • IOPA server to run on both Node and NodeKit
  • IOPA router for server-side URL routing
  • IOPA static to server up static files (e.g., css, js, etc.)
  • IOPA templates engine including handlebars
  • IOPA connect to use vanilla Node HTTP transport

Installation

npm install iopa-core

Basic Example

const iopa = require('iopa-core'),
      static = iopa.static,
      templates = iopa.templates,
      router = iopa.router,
      handlebars = iopa.handlebars;
      
var app = new iopa.App();
       
app.use(templates);

app.use(router);

app.engine('.hbs', handlebars({
    defaultLayout: 'main', 
    views: 'views'
 }));
    
app.use(static(app, './public'));

app.get('/', function (context) {
   return context.render('home.hbs');
});

http.createServer(app.buildHttp()).listen(3000);

Build

git clone https://github.com/iopa-io/iopa-core.git 
npm install
npm run build

Minified version of entire IOPA fabric is placed in dest directory

Distribution

Simply copy the dest directory to your next project for a drop in expressjs like replacement.

About

Full stack IOPA fabric in single 160Kb javascript including router, static file server, template engine w/ handlebars

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published