project files:
index.html :
<!DOCTYPE html> <html> <head> <script src="test.js "></script> </head> <body> <h1> Hallo World! </h1> </body>test.js :
"use strict"; var superagent = require('superagent'); superagent.get('/testRequest');
The problem is that the browser can not cause require.
Advise the decision, please.