fix(app): an empty mountpoint mounts at the root again (GitHub #31)
GitHub #32 (merged from contrib) made `createApp` fail with a message naming the module when its `@Module` metadata has no `mountpoint`, instead of a TypeError from `joinPath`. The check tested falsiness, so it also refused `mountpoint: ''`, which the type allows and which has always mounted at the root (`joinPath('', '/hi')` is `/hi`). Test for `typeof … !== 'string'` instead: a missing or non-string mountpoint still fails with the new message, and `''` boots as before. The CHANGELOG entry for #31 that #32 did not add is included. Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
3 files changed
+25
-1
No files matched your search
@@ -260,6 +260,12 @@ npm treats versions as semver and semver forbids leading zeros.
|
||||
|
||||
### Fixed
|
||||
|
||||
- **A `@Module` without a `mountpoint` names itself at boot** (GitHub #31). The type
|
||||
requires it, but JavaScript or transpile-only code could still omit it, and `createApp` failed
|
||||
with `Cannot read properties of undefined (reading 'replace')` from inside the path helper. It now
|
||||
fails with `<Module> @Module metadata is missing mountpoint`. `mountpoint: ''` still mounts at the
|
||||
root.
|
||||
|
||||
- **`listen()` rejects when the port is taken** (#138). A bind failure such as `EADDRINUSE` or
|
||||
`EACCES` arrives as the server's `error` event, which `listen()` did not handle: the promise
|
||||
never settled, and the error surfaced as an unhandled one. It now rejects with that error. The
|
||||
|
||||
Reference in new issue
Block a user