Last active
June 4, 2017 12:59
-
-
Save TheNoim/a8923ba1bb4f81b7c854bf8edbce059c 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
fs.readFile(path, function (err, contents) { | |
if(err) callback(err, null); | |
r.db('db').table('images').insert({ | |
user: name, | |
file: contents, | |
elo: 1000 | |
}).run(); | |
}) | |
// Express Router context | |
r.db('db').table('images').// Deine Query | |
.run().then(result => { | |
res.set('Content-Type', 'image/jpeg'); | |
res.set('Content-Length', result.file.length); | |
res.end(result.file); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment