I recently was introduced to Netlify functions and it seems to be going fine. I recently developed a semi-serverless app which uses Netlify for all operations except for authentication.
It all works well in development stage after testing. I am trying to deploy it to a server(not netlify as I have already paid for a cloud server running nginx)
I am now on the server. I have “build” the app with “netlify build” and I am running it with an express script
const express = require('express');
const compression = require('compression');
const path = require('path');
const app = express();
app.use(compression());
app.use(express.static(path.join(__dirname, 'build')));
app.get('*', function(req, res) {
res.sendFile(path.join(__dirname, 'build', 'index.html'));
});
const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
console.log(`App is running on port ${PORT}`);
});
The site and backend(authentication) works but all netlify functions doesn’t. I can see that functions didn’t respond. I have gone through so many documentation, It’s skull splitting. I don’t know exactly what is wrong, There doesn’t seem to be a command the runs like netlify dev for production.
I have not yet linked the server IP to a domain yet so I can’t share that here.
And if netlify doesn’t allow use of its technology if it’s not deployed to their server, I would also like to know.