I was getting a 502 Bad Gateway response when accessing my app via the ingress resource.
- Ingress config (looked fine)
- Service config (looked fine)
- Assumed the fault was in the k8s configuration
I was getting a 502 Bad Gateway response when accessing my app via the ingress resource.
| import statistics as stat | |
| import math | |
| def computeIntensity(list): | |
| readings = [x * 1000 for x in list] | |
| intensity = stat.mean(readings) - bg_intensity | |
| return intensity | |
| /* | |
| Caeser's Cypher | |
| implemented by your's truly :) | |
| */ | |
| // since we are in a node environment, this is how we get input from the terminal | |
| // note: i'm only get the first two arguments from the input array, excluding 'node app.js' | |
| const [plainText, key] = process.argv.slice(2); | |
| // makes sure plainText is in lowercase and trims |
| /* | |
| so uhm, up until about a week ago, my | |
| defacto method for handling errors in an | |
| async/await program-flow was to wrap my | |
| entire code-block in a try/catch; performing | |
| the operations in the `try {}` block and | |
| handling any errors in the `catch(err) {}` block. | |
| it worked well, but it didn't sit well with me |
| const fs = require('fs').promises | |
| const path = require('path') | |
| const getData = async (dirName) => { | |
| try { | |
| const buffer = await fs.readFile(dirName) | |
| const data = await JSON.parse(buffer) | |
| return data | |
| } catch (err) { | |
| console.error(err) |