TitBits of Node.js — Part-2

📄 Table of contents

Create a connection between Node and JS

◉ Serve Static Files (Include CSS and JS files in Node.js)

app.use(express.static(path.join(__dirname, 'public')));
var express = require('express');
var path = require('path');
<link rel='stylesheet' href='/style.css' />

◉ run both client & server simultaneously

npm install concurrently

◉ View Engines

res.render(‘home’); //renders a view (engine) from noderes.send() // to send something from nodejs to frontendres.sendFile() // send file to frontend from nodejs# Whenever we have to send data (POST) to backend…we need to use a package body-parser .

Experience with Front-end Technologies and MERN / MEAN Stack. Working on all Major UI Frameworks like React, Angular.