Skip to content

Commit

Permalink
Do the thing.
Browse files Browse the repository at this point in the history
  • Loading branch information
AKPWebDesign committed Nov 15, 2016
1 parent 5de6b33 commit 2428fd4
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
25 changes: 25 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Copyright (c) 2016 Austin Peterson

The following license applies to all parts of this software except as
documented below:

====

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 changes: 28 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "node-urandom-server",
"version": "1.0.0",
"description": "A node.js web server that just serves from /dev/urandom.",
"main": "server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/AKPWebDesign/node-urandom-server.git"
},
"keywords": [
"urandom",
"express",
"random"
],
"author": "Austin Peterson <[email protected]> (https://blog.akpwebdesign.com)",
"license": "MIT",
"bugs": {
"url": "https://github.com/AKPWebDesign/node-urandom-server/issues"
},
"homepage": "https://github.com/AKPWebDesign/node-urandom-server#readme",
"dependencies": {
"express": "^4.14.0",
"randbytes": "0.0.1"
}
}
13 changes: 13 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
var e = require('express')
var a = e()
var p = process.env.PORT || 8080
var r = new (require('randbytes')).urandom.getInstance()

a.get('/', (req, res) => {
r.getRandomBytes(5000, (b) => {
res.header('Content-Type', 'text/html')
res.send(b)
})
})

a.listen(p, () => { console.log(`Listening on port ${p}.`) })

0 comments on commit 2428fd4

Please sign in to comment.