forked from EMC-UI/emc-stash-widget
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
41 lines (35 loc) · 1.14 KB
/
Copy pathserver.js
File metadata and controls
41 lines (35 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
var express = require('express');
var tally = require('tally');
var app = express();
var url = require('url');
var userStatsMock = require('./mock/userStats.json');
var projectStatsMock = require('./mock/projectStats.json');
app.get('/stats/userStats', function (req, res) {
// var urlParts = url.parse(req.url, true);
// tally.userStats(urlParts.query.prevDays).then(function(result) {
// res.json(result);
// });
res.json(userStatsMock);
});
app.get('/stats/projectStats', function (req, res) {
// var urlParts = url.parse(req.url, true);
// tally.projectStats(urlParts.query.prevDays).then(function(result) {
// res.json(result);
// });
res.json(projectStatsMock);
});
app.get('/stats/repoStats', function (req, res) {
//var urlParts = url.parse(req.url, true);
//tally.repoStats(urlParts.query.prevDays).then(function(result) {
// res.json(result);
//});
res.json({});
});
app.get('/create', function(req, res) {
tally.createData(30);
res.send('building');
});
app.listen(3000, function () {
console.log('Example app listening on port 3000!');
});
app.use(express.static('.'));