netlify / netlify/cli

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

Open
#6,518 7 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: command: functions area: functions type: bug
Dominant language
TypeScript
Stars
1.9k
Forks
474
Avg merge
23h 30m
Merged PRs (30d)
53

Description

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     

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with netlify functions:serve and the provided [functions] directory configuration, then compare the behavior with netlify functions:list. Trace how these commands handle the configured function path and custom routes. Done means /api/hello resolves locally and the list command reports the configured URLs.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.