Skip to content

Instantly share code, notes, and snippets.

@rao123dk
Forked from gaearon/node_hot_reload.js
Created November 9, 2019 11:39
Show Gist options
  • Select an option

  • Save rao123dk/f265279ba8de3af7f9be998766a2d922 to your computer and use it in GitHub Desktop.

Select an option

Save rao123dk/f265279ba8de3af7f9be998766a2d922 to your computer and use it in GitHub Desktop.
const express = require('express');
const app = express();
// Application
app.get('/', function(req, res) {
if (process.env.NODE_ENV === 'development') {
for (var key in require.cache) {
delete require.cache[key];
}
}
require('./handler')(req, res);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment