Netlify functions do not seem to work with the latest Nuxt 3.0.0.
I added a folder called “functions”, made a small event handler in this directory /functions/hello.js
exports.handler = async (event) => {
const response = {
statusCode: 200,
body: JSON.stringify("Merry Christmas!"),
};
return response;
};
I also added a netlify.toml file
[build]
functions = "functions"
[[redirects]]
from = "/function/*"
to = "/.netlify/functions/:splat"
status = 200
This will always throw a 404 when I run netlify dev
- http://localhost:3000/function/hello
THis also throws an error http://localhost:3000/.netlify/functions/hello