Skip to content

Commit

Permalink
implement basic structure
Browse files Browse the repository at this point in the history
  • Loading branch information
stsourlidakis committed Oct 28, 2016
1 parent 4be6b4f commit aebe2c3
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/node_modules
20 changes: 20 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -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+'!');
});
29 changes: 29 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -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 <'[email protected]'>",
"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"
}
}
17 changes: 17 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>

<html>
<head>
<title>New article</title>
<meta charset="utf-8">
</head>
<body>
<form method="POST" action="./article">
<input type="text" name="articleTitle" placeholder="Article Title"></input>
<br>
<textarea name="articleBody"></textarea>
<br>
<input type="submit"></input>
</form>
</body>
</html>

0 comments on commit aebe2c3

Please sign in to comment.