cannon-blog

A ReactJS Blogging engine

Usage no npm install needed!

<script type="module">
  import cannonBlog from 'https://cdn.skypack.dev/cannon-blog';
</script>

README

Cannon

A server and client side ReactJS powered blogging engine.

Please note Cannon is not ready yet! By all means try and use it but you'll definitely run into lots of problems. I'm keeping a rough plan of work in the Trello board.

How

Cannon is run as a series of ExpressJS middlewares that you run on a server locally whilst building and developing your site. Once you're ready to deploy, Cannon provides you with a tool to generate a directory of static files containing your application. These can then be pushed live (GitHub Pages, Amazon S3, for example) to any host that can store static files. No server is needed in production, and your site will work in clients with and without JavaScript enabled.

The idea from Cannon and a lot of the approach is taken from How we built the new gocardless.com.

Getting Started

Cannon is currently very unstable and should not be considered ready for use. As it gets to that stages more documentation will be written.

Your first step is to create a new empty folder for your project and run:

npm init
npm install --save cannon-blog

This will create a new project and install cannon-blog. Cannon provides a script for initialising a new project:

cannon-init

The init script will install other dependencies required (React, Express and others) and then create a small site for you containing an index page and one blog post.

You can then fire up the development server:

./node_modules/.bin/cannon-dev

And in another tab, the webpack server which will generate and serve the clientside bundle.

./node_modules/.bin/cannon-webpack

And visit http://localhost:8123 to see your new blog in all its glory.

Note that the very first time you run cannon-dev, you will see an error. Currently you have to hit the site first for the bundle to be correctly generated. Then you can restart the server and everything should work. This is on the list of TODOs!

Adding pages and posts

Coming Soon

Available Middlewares

Coming Soon