node package manager
Don’t reinvent the wheel. Reuse code within your team. Create a free org »

react-koa

react-koa

What is react-koa?

React-koa is a super slim app boilerplate that uses koa framework and it gets you started with all the good stuff in less than a minute - no fuss, no weird setup, no nonsense.

Focus on what you really love - making amazing stuff!

Features

  • {new in 1.0.1} Babel 6 with full ES6 syntax (=>, import...)
  • KoaJS instead of Express - welcome to the future [generators, async heaven]
  • React Hot Loader - Edit components in real time
  • koa-static handles serving
  • Template agnostic - Uses little renderfile tool to render html
  • Bootstrap to make your new app look all shiny and gorgeous
  • Webpack to make everything beautifully packaged

NB: Use webpack.config.js to toggle between dev server (with hot reload) and bundling files for launching the app (notes in the file).

Installation notes

Install using npm:

npm install react-koa

Just take out react-koa folder out of node-modules and rename it to whatever your app is going to be called and immediately start making cool stuff.

Important stuff

Once installed run npm start which will pack React code and start the server.

Use localhost:3001/webpack-dev-server to get hot reload, localhost:3000 is still reserved only for ExpressJS (production ready)

Here's how routing and rendering works:

router
    .get('/api', function*(){
        // This is where we use the custom renderfile.js as render function
        this.body = yield render (__dirname + '/public/filename.html')
    })
    .get('/path', function*(){ ... })

NB: index2.html is used just to test out routing. You can delete it or rename it.

Thanks for downloading. Now create something amazing.

forthebadge