Deploying Express with React - 404 status code

As I’m attempting to deploy my first project which uses React and Express, I’m looking how to do just that. I’ve gone over how to do with this with Netlify with the following:

Within my repo, there consists of a client directory to contain everything React and a server directory to contain everything Express. With how the repo is structured and where I’m at with my project currently, I’m finished with the Express/server side of things. I wanted to deploy Express without React since I haven’t started on client side code. Thus Use Express without a frontend seemed appropriate here. Following the step by step process mentioned in the articles, I’m getting a 404. Following deployed my site but i still see page not found I’m still lost as to how to remedy this issue where the 404 is ultimately resolved.

Site name: https://timestamps-microservice.netlify.app/

Repo: GitHub - 0binny0/timestamp_microservice

Build settings:

Runtime: Not set
Base directory: server
Package directory: Not set (shows /server when clicking "Configure" in Build Settings)
Build command: echo Building Functions
Publish directory: Not set  (shows /server when clicking "Configure" in Build Settings)
Functions directory: server/netlify/functions/netlify
Deploy log visibility: Logs are public
Build status: Active

@0binny0 I can’t advise on the specifics of how to fix, since you’re working in a way that I never did on Netlify (using Express via Functions to deliver dynamic runtime content).

However I can see that you’ve inadvertently just deployed the files in your /server/ folder.

Examples:

https://timestamps-microservice.netlify.app/package.json
https://timestamps-microservice.netlify.app/handlers.js
https://timestamps-microservice.netlify.app/netlify/functions/netlify/index.js
etc

There’s no mention of this in the instructions. What would be the reasoning behind adding this? As result of doing this the Express app is now being serving the URLS.

adding functions = "netlify/functions/" under the [build] section in the netlify.toml file seems to fix it.

https://answers.netlify.com/t/deploy-express-js-to-netlify/91801/13

Yet the source files are still being displayed as you mentioned like package.json as example. I’m not clear on what do to this fix this particular issue now.

I struggled to find any reference in the documentation to:

[build]
functions = 'directory-here'

However based on this post I believe that it’s the legacy way of performing:

[functions]
directory = 'directory-here'

As that post mentions, you should only need to specify it if the functions directory is not the default one, and the Express on Netlify documentation seems to assume the default directory is used.

You can provide feedback on the documentation with the forms at the bottom of the pages:

In regards to the files that are deployed, Netlify deploys the files that are in the Publish directory, if that directory contains source files, then source files are deployed.