Friday 19 May 2017

How do I fix the folder path of included routes from a blog built within a site using NODE.js?

I'm doing a blog inside a dynamic website using NODE.js. However when I do the blog routes, when I include the "partials / header" for them, the programming does not find any paths of folders more.

this is the app on GitHub https://github.com/EddieS42/WebRT


Code of "header.ejs":

app.get("/blog-PT", function(req,res){
 res.render("blog_PT",{matters: matters});
})

app.post("/blog-PT", function(req, res){
 res.send("YOU HIT THe POST ROUTE!")
});

app.get("/blog-PT/new", function(req,res){
 res.render("new.ejs");
});


Code of "header.ejs":

<html lang="en">
<head>
 <meta charset="utf-8">
 <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
 <meta http-equiv="X-UA-Compatible" content="IE=edge">
 <title>Rafaela Tillier</title>
<!-- Library -->
 <!-- bootstrap -->
 <link href="bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
 <!-- fontAwesome -->
 <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
 <!-- Google fonts -->
 <link href="https://fonts.googleapis.com/css?family=Josefin+Sans:400,700" rel="stylesheet">
<!-- custom css-->
 <link href="css/stylesheets.css" rel="stylesheet">
 <link href="css/navbar.css" rel="stylesheet">
 <link href="css/contact.css" rel="stylesheet">
 <link href="css/credits.css" rel="stylesheet">
<!-- <link rel="stylesheet" href="public/css/landing.css"> -->
</head>


Code I used in "new.ejs":

<% include partials/headerBlog %>

<div class="container">
 <h1>Create a new post</h1>
 <form action="/blog-PT" method="POST">
  <input type="text" placeholder="title">
  <input type="text" placeholder="image">
  <input type="text" placeholder="content">
 </form>
</div>

<% Include partials / footerBlog%>



via Eduardo Rocha

No comments:

Post a Comment