CSS and Images files are not working in my application getting error "Refused to apply style from '' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled"
I have tried "server.use(express.static(path.join(__dirname, 'public')));" but still not working ...
const express = require('express');
//const expressLayouts = require('express-ejs-layouts');
const mongoose = require('mongoose'); mongoose.set('useCreateIndex', true);
const passport = require('passport');
const flash = require('connect-flash');
const session = require('express-session');
const server = express();
const path = require("path");
const bodyParser = require("body-parser");
//Set path for static assets
//server.use(expressLayouts);
server.set('view engine', 'ejs');
//server.set('view options', { layout: false });
server.set('views', path.join(__dirname, 'views'));
server.engine('html', require('ejs').renderFile);
//Set path for static assets
server.use(express.static(path.join(__dirname, 'public')));
// Express body parser
server.use(express.urlencoded({ extended: true }));