Skip to content

Commit

Permalink
Add logs to try and figure out what's going on with sendgrid
Browse files Browse the repository at this point in the history
ronshapiro committed Oct 30, 2024
1 parent c1a26d3 commit e3d7c51
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions express.ts
Original file line number Diff line number Diff line change
@@ -479,6 +479,10 @@ app.get('/sitemap.xml', (req, res) => {
.send(new Sitemap(`https://${req.hostname}`).generate());
});

console.log("realpath", fs.realpathSync("."))
console.log("ls .", fs.readdirSync("."))
console.log("ls ..", fs.readdirSync(".."))
console.log("Sendgrid api key exists?", fs.existsSync("sendgrid_api_key"));
if (fs.existsSync("sendgrid_api_key")) {
sendgrid.setApiKey(fs.readFileSync("sendgrid_api_key", {encoding: "utf-8"}));
app.post("/corrections", async (req, res) => {
2 changes: 2 additions & 0 deletions parcel.ts
Original file line number Diff line number Diff line change
@@ -29,8 +29,10 @@ const entryFiles = [
];

const isProd = (() => {
console.error("argv", process.argv);
switch (process.argv[2]) {
case "prod":
console.error("sendgrid_api_key existence:", fs.existsSync("sendgrid_api_key"));
if (!fs.existsSync("sendgrid_api_key")) {
throw new Error("Could not find sendgrid_api_key file, which is necessary to deploy.");
}

0 comments on commit e3d7c51

Please sign in to comment.