Express boilerplate
This commit is contained in:
+4
-2
@@ -1,2 +1,4 @@
|
||||
.idea
|
||||
node_modules
|
||||
/.idea
|
||||
/node_modules
|
||||
/config.json
|
||||
/data
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"esversion": 6,
|
||||
"maxerr": 999,
|
||||
"indent": true,
|
||||
"camelcase": true,
|
||||
"eqeqeq": true,
|
||||
"forin": true,
|
||||
"immed": true,
|
||||
"latedef": true,
|
||||
"noarg": true,
|
||||
"noempty": true,
|
||||
"nonew": true,
|
||||
"undef": true,
|
||||
"unused": true,
|
||||
"varstmt": true,
|
||||
"sub": true,
|
||||
"quotmark": "single",
|
||||
"browser": true,
|
||||
"jquery": true,
|
||||
"devel": true,
|
||||
"node": true,
|
||||
"globals": {
|
||||
}
|
||||
}
|
||||
@@ -14,9 +14,10 @@ A static blog using Markdown pulled from your git repository.
|
||||

|
||||
|
||||
## Installation
|
||||
**1. Download the latest version from the repo**
|
||||
**1. Download and install the latest version from the repo**
|
||||
```bash
|
||||
git clone https://github.com/klemek/gitblog.md.git
|
||||
npm install
|
||||
```
|
||||
**2. Create your config file**
|
||||
```bash
|
||||
@@ -27,13 +28,13 @@ then edit the config.json file with your values :
|
||||
> default values for config.json
|
||||
````json
|
||||
{
|
||||
"node_port": 3000,
|
||||
"data_dir": "data",
|
||||
"nodePort": 3000,
|
||||
"dataDir": "data",
|
||||
"modules" : {
|
||||
"plantuml" : true,
|
||||
"rss": true,
|
||||
"webhook": true
|
||||
},
|
||||
"plantuml" : true,
|
||||
"rss": true,
|
||||
"webhook": true
|
||||
},
|
||||
"home" : {
|
||||
"index" : "index.ejs"
|
||||
},
|
||||
@@ -41,16 +42,27 @@ then edit the config.json file with your values :
|
||||
"index" : "index.md"
|
||||
},
|
||||
"rss" : {
|
||||
"endpoint" : "/rss",
|
||||
"endpoint" : "/rss",
|
||||
"length" : 10
|
||||
},
|
||||
"webhook" : {
|
||||
"endpoint": "/webhook",
|
||||
"secret_file": "git_secret"
|
||||
"secretFile": "git_secret"
|
||||
}
|
||||
}
|
||||
````
|
||||
**3. Create and init your git source**
|
||||
|
||||
**3. Start your server**
|
||||
|
||||
```bash
|
||||
npm start
|
||||
#or
|
||||
node server.js
|
||||
```
|
||||
|
||||
This might want to use something like screen to separate the process from your current terminal session.
|
||||
|
||||
**4. Create and init your git source**
|
||||
|
||||
You need to [create a new repository](https://github.com/new) on your favorite Git service.
|
||||
|
||||
@@ -61,7 +73,7 @@ git remote add origin <url_of_your_repo.git>
|
||||
git push -u origin master
|
||||
```
|
||||
|
||||
**4. Refresh content with a webhook (optional)**
|
||||
**5. Refresh content with a webhook (optional)**
|
||||
|
||||
At first start, a `git_secret` file will be generated, use it to create a new webhook as following :
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
const express = require('express');
|
||||
const app = express();
|
||||
|
||||
module.exports = function(/*config*/){
|
||||
app.get('/', (req,res) => {
|
||||
res.status(200).send('Hello World!');
|
||||
});
|
||||
|
||||
return app;
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"nodePort": 3000,
|
||||
"dataDir": "data",
|
||||
"modules" : {
|
||||
"plantuml" : true,
|
||||
"rss": true,
|
||||
"webhook": true
|
||||
},
|
||||
"home" : {
|
||||
"index" : "index.ejs"
|
||||
},
|
||||
"article" : {
|
||||
"index" : "index.md"
|
||||
},
|
||||
"rss" : {
|
||||
"endpoint" : "/rss",
|
||||
"length" : 10
|
||||
},
|
||||
"webhook" : {
|
||||
"endpoint": "/webhook",
|
||||
"secretFile": "git_secret"
|
||||
}
|
||||
}
|
||||
Generated
+9758
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"name": "gitblog.md",
|
||||
"version": "1.0.0",
|
||||
"description": "A static blog using Markdown pulled from your git repository.",
|
||||
"main": "server.js",
|
||||
"dependencies": {
|
||||
"express": "^4.17.1",
|
||||
"ncp": "^2.0.0",
|
||||
"node-plantuml": "^0.8.1",
|
||||
"showdown": "^1.9.0",
|
||||
"xml": "^1.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-cli": "^6.26.0",
|
||||
"babel-preset-env": "^1.7.0",
|
||||
"jest": "^24.8.0",
|
||||
"superagent": "^5.1.0",
|
||||
"supertest": "^4.0.2"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "jest"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/klemek/gitblog.md.git"
|
||||
},
|
||||
"author": "klemek",
|
||||
"license": "ISC",
|
||||
"bugs": {
|
||||
"url": "https://github.com/klemek/gitblog.md/issues"
|
||||
},
|
||||
"homepage": "https://github.com/klemek/gitblog.md#readme"
|
||||
}
|
||||
Reference in New Issue
Block a user