Can nightbot post to an express api?

Asked Nov 7, 2023·1 reply·Last activity 2 years ago·Open in Discord ↗
Archived from the original community forum
Things may have changed since it was written. Still stuck? Ask the community on Discord.

I have a simple node js express route that will fetch osrs high scores.
The expectation is that users will type in "!stats zezima" and it will post zezima to my api route, then return the stats for zezima. When I curl my API I get the expected response.

curl -X POST -H "Content-Type: application/json" -d '{"rsUsername": "zezima"}' http://myapi:8088/fetch-rs-stats

Stats for zezima: overall: 1,465 ~ attack: 76 ~ defence: 76 ~ strength: 75 ~ hitpoints: 75 ~ prayer: 52 ~ cooking: 80 ~ woodcutting: 78 ~ fletching: 74 ~ fishing: 77 ~ firemaking: 99 ~ crafting: 55 ~ smithing: 55 ~ mining: 63 ~ herblore: 52 ~ agility: 70 ~ thieving: 53 ~ slayer: 71 ~ farming: 45 ~ runecraft: 44 ~ hunter: 45 ~ construction: 45

Nightbot command:

$(urlfetch http://myapi.com:8088/fetch-rs-stats?rsUsername=$(1))

Nightbot keeps chatting Remote Server Returned Code 404

My API isnt blocking any traffic. All source IP and port are allowed.

1 reply