Skip to content

json route table read fails on change #261

@bazjapan

Description

@bazjapan

fs.watchFile(this.routeFile, function () {
fs.readFile(self.routeFile, function (err, data) {
if (err) {
self.emit('error', err);
}
console.log(data);

logs - <Buffer >

SyntaxError: Unexpected end of input
at Object.parse (native)
at /home/bazjapan/app/node_modules/http-proxy/lib/node-http-proxy/proxy-table.js:69:29
at [object Object]. (fs.js:123:5)
at [object Object].emit (events.js:64:17)
at Object.oncomplete (fs.js:1190:12)

The json is fine, however readFile is returning a buffer and thusly json.Parse freaks out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions