How To Build A Markdown Blog Using Node.js, Express, And MongoDB

Web Dev Simplified · 478K views · 2020 · 1:02:28

Open on YouTube

Web developmentDatabases & storagetutorialdated

Why Stack Overflow recommends it

Stack Overflow users cite it as the tutorial they were following when they hit Mongoose connection errors, library version breakages, or EJS rendering problems in their own copy of the project.

Recommended by 1 people across 1 different months, 2020 to 2024.

What it is

A one-hour build-along tutorial from Web Dev Simplified in which Kyle creates a markdown blog with Node.js, Express, MongoDB/Mongoose and EJS. It covers server setup, database models and hooks, routing, and the structure of a full stack app.

What people said

Recommends Kalyan Sundar · 2023-07 · Stack Overflow · on “Related to the node.js experimental setup”

Thanks. Nope I am didnt meant to use it. i am following the video and working things out on my end. if you could take a look at this " [this video] " video. I have frozen it at the point where kyle declares the find by ID. i am not sure as to what argument he is using. He has used the word "article" for almost everything through out the video from constants to variables to even naming the JS file

Cites Dave Dasalla Didal · 2020-07 · Stack Overflow · on “My node express app can't connect locally to mongodb using mongoose”

I'm using macOs. I have followed the web dev tutorial on [LINK] and [this video] . It is a simple node app with the ff npm installations: express pug mongoose ("^5.9.26") --save-dev nodemon Note that MongoDB is not installed in my computer as it was not required by the tutorials. Here is my code: const mongoose = require('mongoose') mongoose.connect('mongodb://localhost/blog', { useNewUrlParser: true, useUnifiedTopology: true }).catch(error => console.log(error)) I have tried changing the server address to the ff without success mongodb://localhost:27017/blog mongodb://127.0.0.1:27017/blog mongodb://127.0.0.1/blog and would continually get the ff error log. How do I get around this? [nodemon] res

Cites connorjrt · 2021-04 · Stack Overflow · on “MongooseError: Operation `articles.insertOne()` buffering timed out after 10000ms, Node.js, Mongoose”

I've been following a tutorial on making a Markdown blog with Mongoose ( [this video] ), Here is the part of the code that seems to be causing the area: const Article = require('./../models/article') const router = express.Router() router.get('/new', (req, res) => { res.render('articles/new', {article : new Article()}) }) router.get('/:id', (req, res) => { res.send(req.params.id) }) router.post('/', async (req, res) => { let article = new Article({ title: req.body.title, markdown: req.body.markdown }) try{ article = await article.save() res.redirect(`/articles/${article.id}`) } catch (e) { console.log(e) res.render('articles/new', {article: article}) } }) module.exports = router When I run this,

Cites Jamie Vaughan · 2021-11 · Stack Overflow · on “nodemon starting `node server.js` TypeError: marked is not a function”

I'm creating a blog, using this 'Web Dev Simplified' tutorial: [this video] I've copied the code from git hub [LINK] , installed the node modules and linked it to my mongodb database online. Node Modules include; express, mongoose, ejs, --save-dev nodemon, slugify, method-override, dompurify, jsdom. The database was working and I could save articles, until I added the last part about sanitizing HTML and converting markdown to HTML, this is when the 'TypeError: marked is not a function' comes up, and the save button ceases to work. Seems a once understood function is now not understood because of a more recent node module dependency, either the dompurify library or jsdom. I'm really out of my dept

Cites Jamie Vaughan · 2022-01 · Stack Overflow · on “Display the most recent Object from an Array (using mongodb and ejs)”

<% blogs.forEach(blog => { %> <h4><%= blog.title %></h4> <p><%= blog.createdAt.toLocaleDateString() %></p> <% }) %> I have a database I can currently access on mongodb, and I'm using express , ejs and node to access and display them on my website the code above is from a tutorial, ( [this video] ) and it will display every 'blog' in my 'blogs' database, but I only want to display one 'blog', the most recent 'blog'. I am fairly new to Javascript, I have some HTML and CSS knowledge.

Cites alexou · 2022-10 · Stack Overflow · on “fix MongooseServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017”

I know there are already alot of posts on this issue, but none of them worked or I didn't know how to do the fix they said. I am learning how to create a server witn node.js with this video: [this video] and now my server crash after 45 sec to 1 min. This is the error code: C:\Users\alexou\Documents\javascirpt\node.js server\node_modules\mongoose\lib\connection.js:824 const serverSelectionError = new ServerSelectionError(); ^ MongooseServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017 at NativeConnection.Connection.openUri (C:\Users\alexou\Documents\javascirpt\node.js server\node_modules\mongoose\lib\connection.js:824:32) at C:\Users\alexou\Documents\javascirpt\node.js server\node_modules\

Cites Menachem D · 2024-03 · Stack Overflow · on “Issue with EJS Templating Syntax Highlighting and Rendering in Visual Studio Code”

This is the tutorial I am following [this video] (Thanks webdev! :). Am my issue is around 9:45 as It doesn't render for me