node-red/red/api
Jeremy Barlow cb35604ef5 Resolve path when sending example file for Windows support
Previously, when trying to import an example into the flow editor on
Windows, the load attempt would fail with an HTTP 404 error in the
browser client, with a `TypeError: path must be absolute or specify
root to res.sendFile` error being written to the Node-RED log. This was
due to the path being passed to the `res.sendFile` function not being
fully-qualified (for example, `\Users\myuser\...\example.json`).

With the changes in this commit, the path to the example file is
resolved to a fully-qualified path before being passed into the
`res.sendFile` call. For example, a path on Windows of
`\Users\myuser\...\example.json` would be transformed to
`C:\\Users\\myuser\\...\\example.json` before being passed along to the
`sendFile` function. This change allows the file to be loaded and sent
properly to the browser client and for the embedded flows in the example
to be loaded in the flow editor.
2018-09-21 08:15:00 -07:00
..
admin Support multiple stores in context sidebar 2018-07-16 16:36:05 +01:00
auth Tidy up default grunt task and fixup test break due to reorder 2018-05-25 11:36:17 +01:00
editor Resolve path when sending example file for Windows support 2018-09-21 08:15:00 -07:00
index.js Move all event emitting into runtime side, not api side 2018-02-28 11:24:12 +00:00
util.js Add /settings/user end point 2017-12-04 17:15:17 +00:00