Skip to content

Commit

Permalink
Merge pull request #14 from MozillaReality/feature/+turkey
Browse files Browse the repository at this point in the history
+turkey
  • Loading branch information
tanfarming authored Apr 23, 2022
2 parents 004fe0d + 04bb478 commit ba248e4
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/nearspark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: nearspark
on:
push:
branches:
paths-ignore: ["README.md"]
workflow_dispatch:

jobs:
turkeyGitops:
uses: mozilla/hubs-ops/.github/workflows/turkeyGitops.yml@master
with:
registry: mozillareality
# dockerfile: Dockerfile
secrets:
DOCKER_HUB_PWD: ${{ secrets.DOCKER_HUB_PWD }}
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM node:lts-alpine
WORKDIR /app
COPY package.turkey.json /app/package.json
RUN npm install
COPY app.js index.js /app/
CMD node app.js
54 changes: 54 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
const lambda = require("./index");
const express = require("express");

const app = express();

// app.get('/_healthz', function (req, res) {
// res.send('1');
// });

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

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);
}
);
});
app.get("/thumbnail", function(req, res) {
console.log(req.url);
console.log(req.query);

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);
}
);
});
app.listen(5000, function() {
console.log("listening on :5000");
});
13 changes: 13 additions & 0 deletions package.turkey.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "nearspark",
"version": "0.0.0",
"description": "",
"main": "app.js",
"dependencies": {
"express": "^4.17.1",
"request": "^2.88.0",
"sharp": "^0.29.1"
}
}


0 comments on commit ba248e4

Please sign in to comment.