1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00
Commit Graph

4 Commits

Author SHA1 Message Date
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
Jeremy Barlow
3938550ea8 Support at sign in module examples path for flows endpoint
This commit allows an example from an npm package that has
an org scoped name (which includes an @ character) to be retrieved and
loaded properly through the flows endpoint.
2018-01-29 15:23:19 -08:00
Nick O'Leary
519edce0ed
Replace when.otherwise() with Promise.catch()
Fixes #1584
2018-01-29 09:51:38 +00:00
Nick O'Leary
41af5187aa
Reorganise red/api layout to better componentise 2017-08-22 22:26:29 +01:00