Created
November 25, 2019 15:35
-
-
Save marked/aca41126f0bc7fd9f76141f508f8a3ba to your computer and use it in GitHub Desktop.
AT mock tracker
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
var sleep = require('sleep'); | |
const express = require('express') | |
const app = express() | |
app.use(express.json()) | |
function random(low, high) { | |
return Math.floor( Math.random() * (high - low) + low ) | |
} | |
app.use((req, res, next) => { | |
console.log(req.body) | |
next() | |
}) | |
app.post('/:project/request', (req, res) => { | |
res.send('{"item_name": "group:' + req.body["downloader"] + '"}') | |
sleep.sleep(1) | |
}) | |
app.post('/:project/upload', (req, res) => { | |
// res.send({"upload_target": "rsync://localhost/sketch/"}) | |
}) | |
app.post('/:project/done', (req, res) => { | |
res.send("OK") | |
}) | |
app.listen(80) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment