netlify/cli

Command functions:serve - Can’t setup custom path for functions

Opened this issue · 2 comments

Describe the bug

According to the documentation for route requests, it should be possible to set up custom route paths for my functions, so I can change the default paths as my needs.

Currently, the Config doesn't work at all, meaning that is like this option is not existent at all.

Steps to reproduce

  1. Clone this repository: https://github.com/TulioPintoNeto/financial-control;
  2. Run the command npm run functions or netlify functions:serve;
  3. Hitting http://localhost:9999/api/hello return 404 (Functions not found...);
  4. Alternatively, you can also use netlify functions:list to check the URLs and see that Config is not doing nothing at all.

Configuration

[functions]
directory = "src/api/routes"

Environment

System:

OS: Windows 10 10.0.19045
CPU: (4) x64 Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz
Memory: 1.04 GB / 7.87 GB

Binaries:

Node: 18.18.2 - C:\Program Files\nodejs\node.EXE     
npm: 10.2.3 - C:\Program Files\nodejs\npm.CMD     

Related: This discussion also happened in Netlify forums https://answers.netlify.com/t/cant-setup-custom-path-for-functions/116319/2 but it was recommended to me to open an issue in CLI GitHub

For further context on whoever sees this, based on this line:

// This is needed for the functions:serve command, where the dev server that normally does the matching doesn't run.
this is probably expected. Though this would be a good improvement to have.