Created
September 28, 2016 14:23
-
-
Save lazywithclass/35069179cd23da46048dd3885a6d0fcc to your computer and use it in GitHub Desktop.
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 app = require('express')(); | |
var env = {}; | |
app.get('/set', function (req, res) { | |
var query = req.query, key = Object.keys(query)[0]; | |
env[key] = query[key]; | |
res.sendStatus(200); | |
}); | |
app.get('/get', function (req, res) { | |
var key = req.query.key; | |
res.status(200).send(env[key]); | |
}); | |
app.listen(4000, function () { | |
console.log('listening on 4000'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment