service.js 390 B

123456789101112131415161718
  1. const path = require('path');
  2. const express = require('express');
  3. const app = express();
  4. app.get('/',function(req,res){
  5. res.sendFile(path.join(__dirname,'moduleTest.html'));
  6. });
  7. app.use(express.static(__dirname + '/js'));
  8. app.listen('3000','0.0.0.0',function(err){
  9. if(err){
  10. console.log(err);
  11. return;
  12. }
  13. console.log('Listening at http://0.0.0.0:3000');
  14. });