TitBits of Node.js — Part-2

Image for post
Image for post

📄 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.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store