tungsten 0.3.8 → 0.3.9
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/.build-complete
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
1786138356533
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StaticSiteServer.d.ts","sourceRoot":"","sources":["../../src/Servers/StaticSiteServer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAClC,OAAO,OAAO,MAAM,SAAS,CAAA;AAK7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAA;
|
|
1
|
+
{"version":3,"file":"StaticSiteServer.d.ts","sourceRoot":"","sources":["../../src/Servers/StaticSiteServer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAClC,OAAO,OAAO,MAAM,SAAS,CAAA;AAK7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAA;AAGrE,qBAAa,gBAAgB;IACzB,MAAM,EAAE,uBAAuB,CAAA;IAE/B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,GAAG,EAAE,OAAO,CAAC,WAAW,CAAA;IACxB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,kBAAkB,EAAE,MAAM,CAAA;gBAEd,MAAM,EAAE,uBAAuB;IAa3C,KAAK,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAW3B;IACD,IAAI,aAEH;CACJ"}
|
|
@@ -9,16 +9,18 @@ export class StaticSiteServer {
|
|
|
9
9
|
// to do
|
|
10
10
|
constructor(config) {
|
|
11
11
|
_defineProperty(this, "config", void 0);
|
|
12
|
-
|
|
12
|
+
//port: number
|
|
13
13
|
_defineProperty(this, "location", void 0);
|
|
14
14
|
_defineProperty(this, "app", void 0);
|
|
15
15
|
_defineProperty(this, "server", void 0);
|
|
16
16
|
_defineProperty(this, "staticSiteLocation", void 0);
|
|
17
17
|
_defineProperty(this, "start", () => {
|
|
18
|
-
const location = this.location = `http://localhost:${this.port}${this.config.siteBasePath}`;
|
|
19
18
|
return new Promise(resolve => {
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
const staticSiteServer = this; // eslint-disable-line @typescript-eslint/no-this-alias
|
|
20
|
+
this.server = this.app.listen(0, function () {
|
|
21
|
+
const port = this.address().port; // eslint-disable-line no-type-assertion/no-type-assertion
|
|
22
|
+
const location = staticSiteServer.location = `http://localhost:${port}${staticSiteServer.config.siteBasePath}`;
|
|
23
|
+
cliNews(`Static preview ready at ${location}`);
|
|
22
24
|
resolve(location);
|
|
23
25
|
});
|
|
24
26
|
});
|
|
@@ -27,7 +29,7 @@ export class StaticSiteServer {
|
|
|
27
29
|
if (this.server !== undefined) this.server.close();
|
|
28
30
|
});
|
|
29
31
|
this.config = config;
|
|
30
|
-
this.port = 3001
|
|
32
|
+
//this.port = 3001
|
|
31
33
|
this.app = express();
|
|
32
34
|
this.staticSiteLocation = join(process.cwd(), staticSiteFolder);
|
|
33
35
|
this.app.use(this.config.siteBasePath, express.static(this.staticSiteLocation));
|