Skip to content

Commit

Permalink
Merge pull request #17 from MozillaReality/feature/turkey-fixes
Browse files Browse the repository at this point in the history
Feature/turkey fixes
  • Loading branch information
tanfarming authored Apr 24, 2022
2 parents ba248e4 + bad7a9c commit 78fffbb
Showing 1 changed file with 23 additions and 24 deletions.
47 changes: 23 additions & 24 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ const app = express();
// });

app.get("/thumbnail/:b64url", function(req, res) {
console.log(req.url);
console.log(req.query);
console.log("req.url",req.url);

lambda.handler(
{
Expand All @@ -20,35 +19,35 @@ app.get("/thumbnail/:b64url", function(req, res) {
},
null,
async function(something, callback) {
console.log("callback: ", callback);
res
.status(callback.statusCode)
.header(callback.headers)
.send(callback.body);
}
);
});
app.get("/thumbnail", function(req, res) {
console.log(req.url);
console.log(req.query);
console.log("callback: ", callback.statusCode, callback.headers);

lambda.handler(
{
queryStringParameters: req.query,
pathParameters: {
url: req.url.replace("/thumbnail", "")
}
},
null,
async function(something, callback) {
console.log("callback: ", callback);
res
.status(callback.statusCode)
.header(callback.headers)
.send(callback.body);
.send(Buffer.from(callback.body, 'base64'))
}
);
});
// app.get("/thumbnail", function(req, res) {
// console.log("req.url",req.url);

// lambda.handler(
// {
// queryStringParameters: req.query,
// pathParameters: {
// url: req.url.replace("/thumbnail", "")
// }
// },
// null,
// async function(something, callback) {
// console.log("callback: ", callback.statusCode, callback.headers);
// res
// .status(callback.statusCode)
// .header(callback.headers)
// .send(callback.body)
// }
// );
// });
app.listen(5000, function() {
console.log("listening on :5000");
});

0 comments on commit 78fffbb

Please sign in to comment.