@joystick.js/node-canary 0.0.0-canary.390 → 0.0.0-canary.391
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
import i from"compression";import _ from"cookie-parser";import c from"cors";import a from"express";import m from"serve-favicon";import t from"./account.js";import d from"./body_parser.js";import u from"./build_error.js";import f from"./context.js";import l from"../../lib/get_joystick_build_path.js";import x from"./hmr_client.js";import o from"./insecure.js";import b from"../../lib/path_exists.js";import w from"./process_browser_polyfill.js";import y from"./render/index.js";import j from"./request_methods.js";import v from"./session.js";const n=l(),k=(e={})=>{e.express_app.enable("trust proxy"),["development","test"].includes(process.env.NODE_ENV)||e.express_app.use(o),e.express_app.use(u),e.express_app.use(j),e?.csp_config&&e.express_app.use((r,p,s)=>csp(r,p,s,e?.csp_config)),process.env.NODE_ENV!=="development"&&e.express_app.use(i()),e.express_app.use(a.static("public")),e.express_app.use("/css",a.static("css")),e.express_app.use("/_joystick/utils/process.js",w),e.express_app.use("/_joystick/index.client.js",a.static(`${e?.joystick_build_path}index.client.js`)),e.express_app.use("/_joystick/index.css",a.static(`${e?.joystick_build_path}index.css`)),e.express_app.use("/_joystick/ui",a.static(`${n}ui`)),process.env.NODE_ENV==="development"&&e.express_app.use("/_joystick/hmr/client.js",x),e.express_app.use(async(r,p,s)=>{await b("public/favicon.ico")?m("public/favicon.ico")(r,p,s):s()}),e.express_app.use(_()),e.express_app.use(d(e?.middleware_config?.bodyParser)),e.express_app.use(c(e?.middleware_config?.cors,e?.port)),process.databases?._sessions&&e.express_app.use((r,p,s)=>v(r,p,s)),process.databases?._users&&e.express_app.use((r,p,s)=>t(r,p,s)),e.express_app.use((r,p,s)=>f(r,p,s)),e.express_app.use((r,p,s)=>y(r,p,s,e?.app_instance))};var J=k;export{J as default};
|
|
1
|
+
import i from"compression";import _ from"cookie-parser";import c from"cors";import a from"express";import m from"serve-favicon";import t from"./account.js";import d from"./body_parser.js";import u from"./build_error.js";import f from"./context.js";import l from"../../lib/get_joystick_build_path.js";import x from"./hmr_client.js";import o from"./insecure.js";import b from"../../lib/path_exists.js";import w from"./process_browser_polyfill.js";import y from"./render/index.js";import j from"./request_methods.js";import v from"./session.js";const n=l(),k=(e={})=>{e.express_app.enable("trust proxy",1),["development","test"].includes(process.env.NODE_ENV)||e.express_app.use(o),e.express_app.use(u),e.express_app.use(j),e?.csp_config&&e.express_app.use((r,p,s)=>csp(r,p,s,e?.csp_config)),process.env.NODE_ENV!=="development"&&e.express_app.use(i()),e.express_app.use(a.static("public")),e.express_app.use("/css",a.static("css")),e.express_app.use("/_joystick/utils/process.js",w),e.express_app.use("/_joystick/index.client.js",a.static(`${e?.joystick_build_path}index.client.js`)),e.express_app.use("/_joystick/index.css",a.static(`${e?.joystick_build_path}index.css`)),e.express_app.use("/_joystick/ui",a.static(`${n}ui`)),process.env.NODE_ENV==="development"&&e.express_app.use("/_joystick/hmr/client.js",x),e.express_app.use(async(r,p,s)=>{await b("public/favicon.ico")?m("public/favicon.ico")(r,p,s):s()}),e.express_app.use(_()),e.express_app.use(d(e?.middleware_config?.bodyParser)),e.express_app.use(c(e?.middleware_config?.cors,e?.port)),process.databases?._sessions&&e.express_app.use((r,p,s)=>v(r,p,s)),process.databases?._users&&e.express_app.use((r,p,s)=>t(r,p,s)),e.express_app.use((r,p,s)=>f(r,p,s)),e.express_app.use((r,p,s)=>y(r,p,s,e?.app_instance))};var J=k;export{J as default};
|
package/package.json
CHANGED
|
@@ -19,7 +19,7 @@ import session_middleware from './session.js';
|
|
|
19
19
|
const build_path = get_joystick_build_path();
|
|
20
20
|
|
|
21
21
|
const built_in = (options = {}) => {
|
|
22
|
-
options.express_app.enable('trust proxy');
|
|
22
|
+
options.express_app.enable('trust proxy', 1);
|
|
23
23
|
|
|
24
24
|
if (!['development', 'test'].includes(process.env.NODE_ENV)) {
|
|
25
25
|
options.express_app.use(insecure_middleware);
|