普通本地函数的调用
var http = require('http'); http.createServer(function(request,response){ response.writeHead(200, {'Content-Type':'text/html;charset=utf-8'}); if(request.url!=="/favicon.ico"){ //清除第2此访问 response.write(fun1()); response.end(''); } }).listen(8000); console.log('Server running at http://127.0.0.1:8000/'); let fun1 = () => { console.log("fun1"); return "你好,我是fun1" }
调用另外一个js文件里的函数—只支持一个函数的