From 0ddd864f5d8b62415759a167c05a4155367917a0 Mon Sep 17 00:00:00 2001 From: MrXyfir Date: Tue, 26 Feb 2019 13:47:46 -0800 Subject: [PATCH] Add STATIC_PATH --- package.json | 6 +++--- server/app.ts | 5 ++++- server/package-lock.json | 2 +- server/package.json | 2 +- types/accownt.d.ts | 5 +++++ web/package-lock.json | 2 +- web/package.json | 2 +- web/webpack.config.js | 4 ++-- 8 files changed, 18 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index da93f55..8ee39af 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "accownt", - "version": "6.0.0-alpha.5", + "version": "6.0.0-alpha.6", "description": "Dead simple user account system so easy a cow could do it.", "main": "index.js", "bin": { @@ -10,8 +10,8 @@ "test": "echo \"Error: no test specified\" && exit 1" }, "dependencies": { - "accownt-server": "6.0.0-alpha.5", - "accownt-web": "6.0.0-alpha.5" + "accownt-server": "6.0.0-alpha.6", + "accownt-web": "6.0.0-alpha.6" }, "prettier": { "singleQuote": true diff --git a/server/app.ts b/server/app.ts index 03cf081..74fe96a 100644 --- a/server/app.ts +++ b/server/app.ts @@ -45,7 +45,10 @@ if (!PROD) { next(); }); } -app.use('/static', Express.static(resolve(process.enve.WEB_DIRECTORY, 'dist'))); +app.use( + process.enve.STATIC_PATH, + Express.static(resolve(process.enve.WEB_DIRECTORY, 'dist')) +); app.use(bodyParser.urlencoded({ extended: true, limit: '2mb' })); app.use(bodyParser.json({ limit: '2mb' })); app.use(cookieParser()); diff --git a/server/package-lock.json b/server/package-lock.json index cc89c70..f7ed5fe 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -1,6 +1,6 @@ { "name": "accownt-server", - "version": "6.0.0-alpha.5", + "version": "6.0.0-alpha.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/server/package.json b/server/package.json index 1f2a0af..1889191 100644 --- a/server/package.json +++ b/server/package.json @@ -1,6 +1,6 @@ { "name": "accownt-server", - "version": "6.0.0-alpha.5", + "version": "6.0.0-alpha.6", "description": "Dead simple user account system so easy a cow could do it.", "main": "dist/app.js", "scripts": { diff --git a/types/accownt.d.ts b/types/accownt.d.ts index 7fc094a..d584bdc 100644 --- a/types/accownt.d.ts +++ b/types/accownt.d.ts @@ -36,6 +36,11 @@ export namespace Accownt { * Your application's name as you want it displayed to users */ NAME: string; + /** + * Base path (for URL) of static files + * @example "/static/" + */ + STATIC_PATH: string; /** * Your application's home page. Generally should not require authentication */ diff --git a/web/package-lock.json b/web/package-lock.json index 6e7ba5e..9a9f988 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -1,6 +1,6 @@ { "name": "accownt-web", - "version": "6.0.0-alpha.5", + "version": "6.0.0-alpha.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/web/package.json b/web/package.json index a00b925..2d59c98 100644 --- a/web/package.json +++ b/web/package.json @@ -1,6 +1,6 @@ { "name": "accownt-web", - "version": "6.0.0-alpha.5", + "version": "6.0.0-alpha.6", "description": "Dead simple user account system so easy a cow could do it.", "main": "", "scripts": { diff --git a/web/webpack.config.js b/web/webpack.config.js index afa4892..473d6e8 100644 --- a/web/webpack.config.js +++ b/web/webpack.config.js @@ -12,7 +12,7 @@ module.exports = { entry: './lib/index.ts', output: { - publicPath: '/static/', + publicPath: process.enve.STATIC_PATH, filename: process.enve.PROD ? '[name].[hash].js' : '[name].js', pathinfo: false, path: path.resolve(__dirname, 'dist') @@ -61,7 +61,7 @@ module.exports = { use: [ { loader: 'file-loader', - options: { publicPath: '/static' } + options: { publicPath: process.enve.STATIC_PATH } } ] }