create express server with view engine

    1

    1

    lucycodes42

    MERN cookbook

    Library: express

    Shortcut: app.mvc

    const express = require('express')
    const app = express()
    require('dotenv').config()
    const port = process.env.PORT || 5000
    
    // !important! 
    // you need to install the following libraries |express|ejs|[dotenv > if required]
    // or run this command >> npm i express ejs dotenv 
    
    app.set('view engine', 'engine')
    
    
    
    app.get('/' , (req , res)=>{
    
       res.send('hello from simple server :)')
    
    })
    
    
    app.listen(port , ()=> console.log('> Server is up and running on port : ' + port))
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.