DEV Community

Stephen A Brooks
Stephen A Brooks

Posted on

Creating Server with Express & Node.js

In your project folder,npm init -y, then run npm i express. Create an index.js file

In the index.js file, that will start up your project at run time, write this code;

`
const express = require('express');
const ejs = require('ejs');
const app = new express();

// this will set the file to be
// viewed in views folder, your
// index.ejs, html, pug, etc.
app.set('view engine', 'ejs');

app.listen(8000, () => (
console.log('App running')
))
app.get('/', (req, res) => {
res.render("index")
});
`
I will be publishing an Express course for allow8ng logins, resgister, delete profile, post blogs, and routing to the blog by the unique id created by Mongoose automatically. If anyone interested in this low cost course, please message me in this thread.

Top comments (1)

Collapse
 
stephenbrooks220413 profile image
Stephen A Brooks

Express, #Node.js, #Mongoose, #Material Design for Bootstrap (MDB)

COURSE LINK
udemy.com/course/express-app-with-...