I getting this error in chrome, after uploading an flutter web app on an ubuntu/nodejs server and i am not sure, if the path is incorrect.
Iam trying to launch an flutter web app on an nodejs server (ubuntu OS), both latest versions. Therefore i followed this guide : Guide and uploaded the default-project with filezilla.
The nodejs server works as expected with an mongodb connection, so i believe the error is caused by the given path.
That is the server folder structure:
root
/nodejsServerFolder/index.js
/ecom/ecom/web/index.html
This is the nodejs code:
const express = require("express");
const http = require("http");
const mongoose = require("mongoose");
const path = require("path");
//CREATE A SERVER
const app = express();
const port = process.env.PORT || 3000;
var server = http.createServer(app);
//MIDDLEWARE
app.use(express.json());
//Envoce flutter website
app.use(express.static(path.join(__dirname, "ecom")));
app.get("*", (req, res) => {
res.sendFile(path.join(__dirname, "ecom/ecom/web/index.html"));
});
Let me know if you need more information!
Thanks