While it may appear similar to previous inquiries, I have explored other solutions without success. Below is my code snippet:
NodeJs:
var express = require("express"),
app = express(),
mongoose = require("mongoose");
mongoose.connect("mongodb://localhost/e_c");
app.use(express.static(__dirname+"public"));
app.use(express.static(__dirname+"partials"));
var blogSchema = new mongoose.Schema({
title: String,
author: String,
pictureForTitle: String,
content: String
});
var blog = mongoose.model("blog",blogSchema);
app.set("view engine","ejs");
app.get("/",function(req,res){
res.render("home");
});
app.listen(process.env.PORT,process.env.IP);
Head.ejs:
<html>
<head>
<link rel="stylesheet" type="text/css" href="/public/css/styles.css">
</head>
<body>
<nav id="navBar">
<div id="aboutSite">
<p>About This Site</p>
<div id="aSDropContent">
<p>About The Author Of This Site</p>
<p>Why The Author Created This</p>
</div>
</div>
</nav>
I've attempted using express.static as shown in the code above, but it's not yielding the desired outcome. I even tried referencing a previous project for guidance.
Sincerely, Josh C.