I am trying to create a scheduled function in netlify for my site: 925f9b60-a694-47a1-b41a-d34bb0c156f7
I am facing two issues:
I have not been able to uccessfully set up netlify dev locally. Everytime i run netlify functions:serve, the inital logs load fine, and then i get
Loaded function api
Request from ::1: GET /api/users
Response with status 404 in 6 ms.
Request from ::1: OPTIONS /api/graphql
Response with status 404 in 11 ms.
I get a 404, for all routes on this.
I used to test my opening a post locally →
app.listen(3000, () => console.log(‘Local app listening on port 3000!’));
But it doesnt help here for testing scheduled functions
I deployed this to my main deploy (not branch deploy) as per the documentation. I see the file in my functions, but not scheduled badge
Even if you did that, I am not sure if that would be used when you use functions:serve. You should simply use netlify dev instead.
Regarding the scheduled functions issue, is that the exact piece of code that you’ve currently deployed? If yes, that should work and it would have to be escalated to the devs.
The app.listen() code is in another file - apptest.ts → which i use for testing locally.
My redirects are configured according to the doc and it works fine in the netlify deployments. Just doesnt work in the local setup using ‘netlify dev’ or netlify functions:serve is failing with the same 404 error. I want this to work correctly to reduce my testing time for scheduled functions.
This is my netlify.toml file
The CLI issue would be not possible to debug without seeing your repo. I have the same setup in several projects of mine and I don’t have an issue with those.
I have escalated the Scheduled Functions error to the devs and will let you know once we hear back from the team.
I dont think i can share my repo, but can share info about it. Its a ts express node app, with this structure, with api.ts in functions folder being the starting point
I tried the schedule with netlify.toml that worked:

Thank you - this works.
Would be great if you can help with tips using debugging locally.