0

I have a working netlify-lambda setup. I run netlify-lambda locally and not in the cloud. Upon running

netlify-lambda serve ./functions

the functions I have defined in the /functions folder are served on localhost:9000

I also have my netlify.toml file in my project root, looking like this:

[build]
  functions = "netlify-lambda"
  publish = "build/"
  command = "npm run build"

[[redirects]]
  from = "/test"
  to = "https://google.com"
  status = 200
  force = true

When I remove the [build] part, then the command "netlify-lambda serve" will result in an error. So I conclude that this file is being used. On the other hand the [[redirects]] instruction does nothing at all.

Requests to

localhost:9000/test

or

localhost:9000/.netlify/functions/test

result in an error like

Function invocation failed: Error: Cannot find module '/home/********/netlify-lambda/test'

What am I missing here?

1 Answer 1

0

As described here: https://answers.netlify.com/t/redirects-not-going-to-index-html/20289

Netlify-lambda will only host your functions and nothing else. You’ll need at least the netlify-cli

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.