#API Routes dont work in Windows

1 messages · Page 1 of 1 (latest)

torpid flame
#

Can't get the API routes to work.
Steps to reproduce:

  1. npx create-medusa-app@latest
  2. curl -o - -I http://localhost:9000/store/custom
    curl returns 404 same with the browser if you try visiting the url.
    The 'custom' route comes with the medusa install.
    Am i pinging the wrong url?
#

I didnt add any custom code, all of the code if from the medusa starter.

tardy lotus
#

I have added a file in src/api/store/custom/route.js

export async function GET(req,res){
  res.sendStatus(200);
}

all works for me

torpid flame
#

This is what I get.

#

Damn I guess if it works for you its fine, its something on my end

#

Sorry for bothering you, thank you for helping me.

tardy lotus
#

Do you actually run your backend at 9000?
Can you show npm list | grep medusa
Also what does http://localhost:9000/health give?

#

Ahh i see the console.log

torpid flame
#

Backend is at default port. In the above SS you can see "Server running on 9000". Health returns OK

#

npm list |grep medusa: C:\Users\User\Desktop\medusaAPIROUTESTEST

tardy lotus
#

Ahh, windows doesn't have grep

torpid flame
#

I ran it in bash its just empty

tardy lotus
#

do you have actually medusa 1.17.2 in package.json?

torpid flame
#

Yes.

tardy lotus
#

Might be something with Windows, not sure.

torpid flame
#

Yeah, ill try it in a vm real quick

torpid flame
#

Yea it works in an ubuntu vm. Could be a windows issue or MY windows install issue.