Giter VIP home page Giter VIP logo

appix's Introduction

Appix 1.0.0-alpha-05 Build Status

  • Es6 Node.js framework dev version
  • Lightweight application framework with dyependency injection and dynamic type checking for node js
  • This application framework is improved version of mvcjs nodejs framework

Features

  1. Appix follow reactive design pattern.
  2. Catch all runtime/syntax errors
  3. Has a dependency injection
  4. Built on top of ES6

Documentation wiki

Hello world example in appix

  • npm install appix

  • app/env.json

{
  "components": {
    "appix/logger": {
      "enabled": true,
      "console": true,
      "level": 30
    },
    "appix/router": {
      "useCustomErrorHandler": false
    }
  }
}
  • app/index.js
'use strict';
let di = require('appix');
let Bootstrap = di.load('@{appix}/bootstrap');
// bootstrap application
let init = new Bootstrap({
  listenPort: 9000,
  appPath:  __dirname + '/'
});
// set bootstrapped instance under custom name
di.setInstance('node', init);
// get router component
let router = init.getComponent('appix/router');
// add some routes
// Route actions are case sensitive!
router.add([
    {
        url: '/',
        route: 'home/Index'
    },
    {
        url: '/goto301',
        route: 'home/Redirect301'
    },
    {
        url: '/goto',
        route: 'home/Redirect'
    },
    {
        url: '/favicon.ico',
        route: 'home/Favicon'
    }
]);
// run server
init.listen();
  • app/controllers/home.js
'use strict';
let di = require('appix');
let Controller = di.load('@{appix}/controller');
// Controllers can be inherited as many levels as you need
class Home extends Controller {

   actionRedirect() {
       return this.redirect('/', 302);
   }

   actionRedirect301() {
       return this.redirect('/', 301);
   }

   actionIndex() {
       return 'Hello world';
   }
}
module.exports = Home;
  • run node app/index.js
  • open localhost:9000

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.