Getting a 404 error while trying to visit site

Site name:


I’ve been debugging all night and finally got my build to work after a few hours of searching for answers. But even though the site is live and published, I’m getting 404 errors. I’m using Express and have this code for my build settings inside my netlify.toml file

  external_node_modules = ["express"]
  node_bundler = "esbuild"
  force = true
  from = "/api/*"
  status = 200
  to = "/.netlify/functions/api/:splat"

I’ve left both my base directory and publish directory settings blank under build settings because I wasn’t sure what to put which is where I think my error is coming from but I can’t seem to figure out exactly how to fix it. I’ve tried setting both to / or public but nothing fixes. My site is cloned from my github which has this as a folder tree.

├── bin
├── models
├── node_models
├── public
├── routes
├── src/scss
├── views
├── app.js
├── netlify.toml
├── package.json
├── package-lock.json
├── .gitignore

@dagger-v See:

TL;DR - You can’t host a Node.js server app with Netlify.

So you’ve deployed your source files to the CDN, e.g.

You can use Express with Serverless functions: