In terms of our server-side application, we can no longer deploy it as a static website. We need to run it using Node.js on the server. Let's create a local.js file in the root directory, which will serve our application using server.js in the dist directory:
const port = process.env.PORT || 8080;
const server = require('./dist/server');
server.app.listen(port, () => {
console.log("Listening on: http://localhost:"+port);
});
Next, we need to export the app variable in our server.ts file and comment out our app.listen call since we are listening to it in the local.js file:
...
export const app = express();
...
// app.listen(PORT, () => {
// console.log(`Node Express server listening on
http://localhost:${PORT}`);
// });
Since we are exporting server.ts, we need to update the...