diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..414ef58 --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,12 @@ +module.exports = function(grunt){ + grunt.initConfig({ + watch: { + files: ["**/*.*"], + options: { + livereload: true + } + } + }); + + grunt.loadNpmTasks('grunt-contrib-watch'); +} diff --git a/README.md b/README.md index a23f6d8..fd27fb8 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,11 @@ # HTML5-Centipede -The arcade game Centipede we know and love but rewritten in HTML5. +The arcade game Centipede we know and love but rewritten in HTML5. Game engine: Phaser. Check them out. Cool stuff, great community. This is the first in my mission to revitalize a few classic arcade games. + +## Running +1. npm install +2. npm start + +Optionally run grunt watch for livereload diff --git a/package.json b/package.json new file mode 100644 index 0000000..f4fbf7f --- /dev/null +++ b/package.json @@ -0,0 +1,25 @@ +{ + "name": "centipede", + "version": "0.0.0", + "description": "The arcade game Centipede we know and love but rewritten in HTML5. Game engine: Phaser. Check them out. Cool stuff, great community.", + "main": "server.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "start": "node server.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/rkram5424/HTML5-Centipede" + }, + "author": "Ryan Kramlich ", + "license": "ISC", + "bugs": { + "url": "https://github.com/rkram5424/HTML5-Centipede/issues" + }, + "homepage": "https://github.com/manufacturedba/HTML5-Centipede", + "devDependencies": { + "restify": "~2.8.5", + "grunt-contrib-watch": "~0.6.1", + "grunt": "~0.4.5" + } +} diff --git a/server.js b/server.js new file mode 100644 index 0000000..caf1ff5 --- /dev/null +++ b/server.js @@ -0,0 +1,22 @@ +var fs = require('fs'); +var restify = require('restify'); +var server = restify.createServer(); + +server.get(/.*/, restify.serveStatic({ + directory: __dirname, + default: 'index.html' +})); + +server.get('/', function(req, res, done){ + fs.readFile('index.html', 'utf8', function(err, html){ + if(err) throw err; + res.setHeader('Content-type', 'text/html'); + res.write(html); + res.end(); + return done(); + }); +}); + +server.listen(8080, function(){ + console.log('Listening at ' + server.url); +});