-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4be6b4f
commit aebe2c3
Showing
4 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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+'!'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |