@o-a/cms-agent 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/server.js +10 -0
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -159,6 +159,16 @@ export async function startServer(siteRoot, options = {}) {
|
|
|
159
159
|
}
|
|
160
160
|
throw error;
|
|
161
161
|
}
|
|
162
|
+
// The real bound port, not just serverConfig.port verbatim - the
|
|
163
|
+
// same reasoning tests already rely on (app.server.address()):
|
|
164
|
+
// port 0 means "OS picks a free one", so echoing the configured
|
|
165
|
+
// value back would print a meaningless 0 in that case. 127.0.0.1,
|
|
166
|
+
// not the 0.0.0.0 bind host above - that's what's actually
|
|
167
|
+
// reachable and clickable from the machine running this.
|
|
168
|
+
const address = app.server.address();
|
|
169
|
+
if (address !== null && typeof address !== 'string') {
|
|
170
|
+
console.log(`Site running at http://127.0.0.1:${address.port}`);
|
|
171
|
+
}
|
|
162
172
|
if (options.tunnel) {
|
|
163
173
|
try {
|
|
164
174
|
tunnel = await (options.startTunnel ?? startDevTunnel)(serverConfig.port);
|