Productivity Boosters

17 Feb 2020 - Sanjeev

Documenting some of tips/tricks that I use regularly while working on web projects. These tricks save you time when needed. Having them in your tool belt always helps.

Serve static content from local folder

If you are a web developer, to tryout a quick sample, you would like to create a web site using the static sample content obtained from some source. Copy past the below content into an server.js file and excute the commmand npm install express and node server.js


		var express = require('express');
		var app = express();

		app.use(express.static(__dirname + '/'));

		app.listen('3000');
		console.log('working on 3000');
	




Do let me know if you have any clarification/suggestion on this post. I will be happy to know your feedback!