Skip to content

Commit

Permalink
handle favicon requests
Browse files Browse the repository at this point in the history
  • Loading branch information
kwiatekus committed Aug 4, 2023
1 parent c370829 commit 57c2311
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions components/function-runtimes/nodejs/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,11 @@ app.get("/metrics", (req, res) => {
getMetrics(req, res)
})

app.get('/favicon.ico', (req, res) => res.status(204));

// Generic route -- all http requests go to the user function.
app.all("*", (req, res, next) => {

const pathname = new URL(req.url, `http://${req.headers['host']}`).pathname

if(pathname === "/favicon.ico") {
next();
return;
}
console.log("Handling request for ",pathname)

res.header('Access-Control-Allow-Origin', '*');
if (req.method === 'OPTIONS') {
Expand Down

0 comments on commit 57c2311

Please sign in to comment.