cesarandreu / trois-blog

third iteration of blog
https://blog.cesarandreu.com/
Apache License 2.0
1 stars 1 forks source link

trois-blog

third iteration of blog

Isomorphic website made with koa and flux/reactjs.

Running

Production

  1. NODE_ENV=production npm run db:create
  2. NODE_ENV=production npm run db:migrate
  3. NODE_ENV=production npm run build
  4. NODE_ENV=production node index.js

Development

  1. npm run db:create
  2. npm run db:migrate
  3. npm run dev

Scripts

Tasks

cron

DEBUG=*
NODE_ENV=production
0 * * * * node --harmony lib/sync_repo_and_load_posts.js >> logs/cron.log 2>&1

Files / Folders

How does it work?

When you visit a page, there's a middleware (client/middleware.js) that loads the client app, it navigates to the page being visited, and then it sends that to the client. Once the user has finished loading, the client app will bootstrap and take over.

The request code is shared. To achieve this supertest is used, and the server instance is passed to it, so it can make a request on itself. Must research if there's better ways to do this.

TODO