Use path.join(__dirname, '/start.html') ; var fs = require('fs'), path = require('path'), filePath = path.join(__dirname, 'start.html'); fs. ... <看更多>
Search
Search
Use path.join(__dirname, '/start.html') ; var fs = require('fs'), path = require('path'), filePath = path.join(__dirname, 'start.html'); fs. ... <看更多>
Node: Create Simple NodeJS server reading a file from fileSystem - app.js. ... <看更多>
fs 模組所提供的 readFile API 提供讀取文件的功能,並且須帶入兩個參數. 欲讀取檔案的路徑; callback function,如認識Node.js 中所 ... ... <看更多>