mirror of
https://github.com/HackPlan/github-commit-ical.git
synced 2026-01-12 15:04:45 +08:00
frontend page
This commit is contained in:
@@ -1,9 +1,13 @@
|
|||||||
express = require 'express'
|
express = require 'express'
|
||||||
request = require 'request'
|
request = require 'request'
|
||||||
|
harp = require 'harp'
|
||||||
|
path = require 'path'
|
||||||
ical = require 'ical-generator'
|
ical = require 'ical-generator'
|
||||||
|
|
||||||
app = express()
|
app = express()
|
||||||
|
|
||||||
|
app.use harp.mount(path.join(__dirname, 'static'))
|
||||||
|
|
||||||
app.get '/:username', (req, res) ->
|
app.get '/:username', (req, res) ->
|
||||||
username = req.param 'username'
|
username = req.param 'username'
|
||||||
|
|
||||||
@@ -14,7 +18,7 @@ app.get '/:username', (req, res) ->
|
|||||||
body = JSON.parse body
|
body = JSON.parse body
|
||||||
|
|
||||||
cal = ical()
|
cal = ical()
|
||||||
cal.setDomain('github-commit-ical').setName("#{username} Commit History");
|
cal.setDomain('commit-calendar.newsbee.io').setName("#{username} Commit History")
|
||||||
|
|
||||||
for item in body
|
for item in body
|
||||||
if item.type == 'PushEvent'
|
if item.type == 'PushEvent'
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"express": "*",
|
"express": "*",
|
||||||
"request": "*",
|
"request": "*",
|
||||||
"ical-generator": "*"
|
"ical-generator": "*",
|
||||||
|
"harp": "*"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
1
static/index.jade
Normal file
1
static/index.jade
Normal file
@@ -0,0 +1 @@
|
|||||||
|
p Hello World
|
||||||
Reference in New Issue
Block a user