@ms-cloudpack/create-express-app 1.0.2 → 1.1.0
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/CHANGELOG.json +16 -1
- package/CHANGELOG.md +10 -2
- package/lib/createExpressApp.d.ts +1 -0
- package/lib/createExpressApp.js +4 -1
- package/lib/createExpressApp.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,22 @@
|
|
|
2
2
|
"name": "@ms-cloudpack/create-express-app",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "Tue,
|
|
5
|
+
"date": "Tue, 22 Nov 2022 08:10:15 GMT",
|
|
6
|
+
"tag": "@ms-cloudpack/create-express-app_v1.1.0",
|
|
7
|
+
"version": "1.1.0",
|
|
8
|
+
"comments": {
|
|
9
|
+
"minor": [
|
|
10
|
+
{
|
|
11
|
+
"author": "dake.3601@gmail.com",
|
|
12
|
+
"package": "@ms-cloudpack/create-express-app",
|
|
13
|
+
"commit": "96959421cca3058863aee2097e83a2911f6cc460",
|
|
14
|
+
"comment": "Added option to set directory to serve as plain static assets."
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Tue, 15 Nov 2022 08:13:12 GMT",
|
|
6
21
|
"tag": "@ms-cloudpack/create-express-app_v1.0.2",
|
|
7
22
|
"version": "1.0.2",
|
|
8
23
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
# Change Log - @ms-cloudpack/create-express-app
|
|
2
2
|
|
|
3
|
-
This log was last generated on Tue,
|
|
3
|
+
This log was last generated on Tue, 22 Nov 2022 08:10:15 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 1.1.0
|
|
8
|
+
|
|
9
|
+
Tue, 22 Nov 2022 08:10:15 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- Added option to set directory to serve as plain static assets. (dake.3601@gmail.com)
|
|
14
|
+
|
|
7
15
|
## 1.0.2
|
|
8
16
|
|
|
9
|
-
Tue, 15 Nov 2022 08:12
|
|
17
|
+
Tue, 15 Nov 2022 08:13:12 GMT
|
|
10
18
|
|
|
11
19
|
### Patches
|
|
12
20
|
|
package/lib/createExpressApp.js
CHANGED
|
@@ -4,7 +4,7 @@ import cors from 'cors';
|
|
|
4
4
|
import compression from 'compression';
|
|
5
5
|
import getPort from 'get-port';
|
|
6
6
|
export async function createExpressApp(options) {
|
|
7
|
-
const { setupCallback, hostname, sslOptions, portRange } = options;
|
|
7
|
+
const { setupCallback, hostname, sslOptions, portRange, publicDir } = options;
|
|
8
8
|
// Get the available port.
|
|
9
9
|
const port = await getPort({
|
|
10
10
|
port: portRange,
|
|
@@ -14,6 +14,9 @@ export async function createExpressApp(options) {
|
|
|
14
14
|
app.use(cors());
|
|
15
15
|
// Use compression.
|
|
16
16
|
app.use(compression());
|
|
17
|
+
if (publicDir !== undefined) {
|
|
18
|
+
app.use(express.static(publicDir));
|
|
19
|
+
}
|
|
17
20
|
// Call setup callback with the app.
|
|
18
21
|
setupCallback?.(app);
|
|
19
22
|
const domain = hostname || 'localhost';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createExpressApp.js","sourceRoot":"","sources":["../src/createExpressApp.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,EAAE,EAAgB,MAAM,SAAS,CAAC;AAChD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,WAAW,MAAM,aAAa,CAAC;AACtC,OAAO,OAAO,MAAM,UAAU,CAAC;AAI/B,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,
|
|
1
|
+
{"version":3,"file":"createExpressApp.js","sourceRoot":"","sources":["../src/createExpressAp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