EJS files and Auth0 don't work

You’re using Express and trying to start a server on Netlify. This doesn’t work. Instead, you need to make use of Netlify Functions. Using Express in Netlify Functions might need some additional config as explained here as a sample boilerplate. Finally, you might need to include your .ejs template in the Functions as explained here.

You can see an average usage of Express on Netlify Functions here.

For your Netlify Function to actually trigger whenever someone tries to access the posts, you would need Netlify Redirects.

While we won’t be able to develop a entire project for you to explore, we can continue leading you at the stages where you get stuck. So, at this point, try migrating your Express code to a Netlify Function and let’s see where that takes us.