gwapes
gwapes
Explore posts from servers
HHono
Created by gwapes on 10/27/2024 in #help
Hono not matching routes
Hi, I’m using hono as my backend server, however it’s not matching routes… everything gets passed to my notFound handler.
import { Hono } from "hono";
import { serve } from '@hono/node-server';
export default async function setupServer(client) {
const app = new Hono();
app.get("/", async (c) => {
return c.json({ message: "Gwapes's API: Version 1" }, 200);
});
app.notFound(async (c) => {
console.log(c.req.url);
return c.json({ message: "Not found" }, 404);
});
// const voteApp = voting(client);
// app.route("/voting", voteApp);
// app.route("/", userApp);
serve({
fetch: (req, env) => {
console.log(req.url, "logging url");
req.headers.forEach((val, key) => console.log(key, val));
return app.fetch(req, env);
},
port: 69,
}, (info) => console.log("Listening on port " + info));
};
import { Hono } from "hono";
import { serve } from '@hono/node-server';
export default async function setupServer(client) {
const app = new Hono();
app.get("/", async (c) => {
return c.json({ message: "Gwapes's API: Version 1" }, 200);
});
app.notFound(async (c) => {
console.log(c.req.url);
return c.json({ message: "Not found" }, 404);
});
// const voteApp = voting(client);
// app.route("/voting", voteApp);
// app.route("/", userApp);
serve({
fetch: (req, env) => {
console.log(req.url, "logging url");
req.headers.forEach((val, key) => console.log(key, val));
return app.fetch(req, env);
},
port: 69,
}, (info) => console.log("Listening on port " + info));
};
I’m using nginx as my proxy to my domain. This is my conf for this server:
location /v1 {
proxy_pass http://localhost:69;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Real-IP $remote_addr; >
proxy_set_header X-Forwarded-For $proxy_add_x_forwarde>
proxy_set_header X-Forwarded-Proto $scheme; >
}
location /v1 {
proxy_pass http://localhost:69;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Real-IP $remote_addr; >
proxy_set_header X-Forwarded-For $proxy_add_x_forwarde>
proxy_set_header X-Forwarded-Proto $scheme; >
}
However I don’t think this is the problem since the requests to go to my server. Versions: - @hono/node-server : 1.13.2 - hono : 4.6.5 Thanks in advance
1 replies
CDCloudflare Developers
Created by gwapes on 8/15/2024 in #workers-help
unknown webhook errors discord http bot
Hey guys, I have a http only bot running on a cf worker and im running into random Unknown webhook problems, mainly for my /meme command, and I have no idea what's wrong or where to go to fix it. Here's the code for my /meme command: https://sourceb.in/yrwYOIxtyS The command "handler": https://sourceb.in/pzY6NMCBQt In my index.ts I just have this https://sourceb.in/n6o9OX2kRH which is just a switch case over all of the types, simple stuff. I believe it's because im trying to "editReply" before the deferReply has "resolved", but im wondering what I can actually do to help this. I have a button too, which this happens with, basically the same code though. Thanks.
36 replies