Skip to content
This repository has been archived by the owner on Jan 6, 2024. It is now read-only.

Commit

Permalink
Add STATIC_PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
MrXyfir committed Feb 26, 2019
1 parent 0d76a3f commit 0ddd864
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 10 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand All @@ -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
Expand Down
5 changes: 4 additions & 1 deletion server/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
5 changes: 5 additions & 0 deletions types/accownt.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
4 changes: 2 additions & 2 deletions web/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -61,7 +61,7 @@ module.exports = {
use: [
{
loader: 'file-loader',
options: { publicPath: '/static' }
options: { publicPath: process.enve.STATIC_PATH }
}
]
}
Expand Down

0 comments on commit 0ddd864

Please sign in to comment.