Home
Support Forums

Node Netlify API url not found

I am trying to build a simple REST API with Node and Express.

Basically any tutorial on the internet its quite easy and straight forward, but for the netlify server seems to be more complicated than should it be, so I have a project that I am trying to figure it out how to set a hello world for this new API.

Project Source: https://github.com/strubloid/node_api
Project Live URL: https://api.strubloid.com

So when I am trying to access https://api.strubloid.com, I am getting some text back so I can manage this endpoint, but when I am trying to access https://api.strubloid.com/api/test it is getting 404.

Anyone can help me out with this?

I also could see that this url is working:

https://api.strubloid.com/.netlify/functions/server/api/test

Is it a way to remove the .netlify/functions/server from the URL? maybe this can fix my issue.

Can you try change your redirect rule to this?

/api/* /.netlify/functions/api/:splat 200!

Since your invocation is not exact just /api, you’ll want to make sure you have the wildcard/splat in your rule. Let me know how that goes.