diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..30bc162 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/node_modules \ No newline at end of file diff --git a/index.js b/index.js new file mode 100644 index 0000000..8b1aeb1 --- /dev/null +++ b/index.js @@ -0,0 +1,20 @@ +var express = require('express'); +var app = express(); +var bodyParser = require('body-parser'); + +app.use(bodyParser.urlencoded({ + extended: true +})); + +app.route('/article') + .get(function (req, res) { + res.sendFile('index.html', {root: './public'}); + }) + .post(function (req, res) { + res.send(req.body.articleTitle+', '+req.body.articleBody); + }); + +var port = 3000; +app.listen(port, function () { + console.log('App listening on port '+port+'!'); +}); \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..7d1b6a8 --- /dev/null +++ b/package.json @@ -0,0 +1,29 @@ +{ + "name": "jekyll-editor", + "version": "1.0.0", + "description": "A simple editor for the DSG jekyll based website", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/DecisionSystemsGroup/jekyll-editor.git" + }, + "keywords": [ + "jekyll", + "editor", + "markdown", + "dsg" + ], + "author": "Stavros Tsourlidakis <'s.tsourlidakis@hotmail.com'>", + "license": "MIT", + "bugs": { + "url": "https://github.com/DecisionSystemsGroup/jekyll-editor/issues" + }, + "homepage": "https://github.com/DecisionSystemsGroup/jekyll-editor#readme", + "dependencies": { + "body-parser": "^1.15.2", + "express": "^4.14.0" + } +} diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..2ec6d91 --- /dev/null +++ b/public/index.html @@ -0,0 +1,17 @@ + + + +
+