From b9db328ab6b79a830e81db5b55a2f87832ac0e81 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 5 Sep 2014 16:28:48 +0100 Subject: [PATCH] initial commit --- .gitignore | 1 + controller/index.js | 13 +++++++++++++ express.js | 5 +++++ index.js | 7 +++++++ package.json | 33 +++++++++++++++++++++++++++++++++ 5 files changed, 59 insertions(+) create mode 100644 .gitignore create mode 100644 controller/index.js create mode 100644 express.js create mode 100644 index.js create mode 100644 package.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..b512c09d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/controller/index.js b/controller/index.js new file mode 100644 index 00000000..c3267192 --- /dev/null +++ b/controller/index.js @@ -0,0 +1,13 @@ + +var pkg = require('../package'); + +function controller( req, res ){ + res.json({ + name: pkg.name, + version: { + number: pkg.version + } + }); +} + +module.exports = controller; \ No newline at end of file diff --git a/express.js b/express.js new file mode 100644 index 00000000..3d7ce944 --- /dev/null +++ b/express.js @@ -0,0 +1,5 @@ + +var express = require('express'); +var app = express(); + +module.exports = app; \ No newline at end of file diff --git a/index.js b/index.js new file mode 100644 index 00000000..9bfec708 --- /dev/null +++ b/index.js @@ -0,0 +1,7 @@ + +var app = require('./express'); + +// api root +app.get( '/', require('./controller/index' ) ); + +app.listen( process.env.PORT || 3100 ); \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 00000000..7ebad061 --- /dev/null +++ b/package.json @@ -0,0 +1,33 @@ +{ + "name": "pelias-api", + "author": "mapzen", + "version": "0.0.0", + "description": "Pelias API", + "homepage": "https://github.com/pelias/api", + "license": "MIT", + "main": "index.js", + "scripts": { + "start": "node index.js", + "test": "echo \"Error: no test specified\" && exit 0" + }, + "repository": { + "type": "git", + "url": "git://github.com/pelias/api.git" + }, + "keywords": [ + "pelias", + "elasticsearch", + "webview" + ], + "bugs": { + "url": "https://github.com/pelias/api/issues" + }, + "engines": { + "node": ">=0.10.26", + "npm": ">=1.4.3", + "elasticsearch": ">=1.2.1" + }, + "dependencies": { + "express": "^4.8.8" + } +}