diff options
-rw-r--r-- | client/config/webpack.dev.js | 217 | ||||
-rw-r--r-- | client/package.json | 7 | ||||
-rw-r--r-- | server/middlewares/oauth.js | 2 | ||||
-rw-r--r-- | server/tests/api/check-params.js | 7 |
4 files changed, 114 insertions, 119 deletions
diff --git a/client/config/webpack.dev.js b/client/config/webpack.dev.js index 5e4c708d6..0b6c00cbd 100644 --- a/client/config/webpack.dev.js +++ b/client/config/webpack.dev.js | |||
@@ -27,135 +27,136 @@ const METADATA = webpackMerge(commonConfig({env: ENV}).metadata, { | |||
27 | * | 27 | * |
28 | * See: http://webpack.github.io/docs/configuration.html#cli | 28 | * See: http://webpack.github.io/docs/configuration.html#cli |
29 | */ | 29 | */ |
30 | module.exports = webpackMerge(commonConfig({env: ENV}), { | 30 | module.exports = function (env) { |
31 | /** | 31 | return webpackMerge(commonConfig({env: ENV}), { |
32 | * Merged metadata from webpack.common.js for index.html | ||
33 | * | ||
34 | * See: (custom attribute) | ||
35 | */ | ||
36 | metadata: METADATA, | ||
37 | |||
38 | /** | ||
39 | * Switch loaders to debug mode. | ||
40 | * | ||
41 | * See: http://webpack.github.io/docs/configuration.html#debug | ||
42 | */ | ||
43 | debug: true, | ||
44 | |||
45 | /** | ||
46 | * Developer tool to enhance debugging | ||
47 | * | ||
48 | * See: http://webpack.github.io/docs/configuration.html#devtool | ||
49 | * See: https://github.com/webpack/docs/wiki/build-performance#sourcemaps | ||
50 | */ | ||
51 | devtool: 'cheap-module-source-map', | ||
52 | |||
53 | /** | ||
54 | * Options affecting the output of the compilation. | ||
55 | * | ||
56 | * See: http://webpack.github.io/docs/configuration.html#output | ||
57 | */ | ||
58 | output: { | ||
59 | /** | 32 | /** |
60 | * The output directory as absolute path (required). | 33 | * Merged metadata from webpack.common.js for index.html |
61 | * | 34 | * |
62 | * See: http://webpack.github.io/docs/configuration.html#output-path | 35 | * See: (custom attribute) |
63 | */ | 36 | */ |
64 | path: helpers.root('dist'), | 37 | metadata: METADATA, |
65 | 38 | ||
66 | /** | 39 | /** |
67 | * Specifies the name of each output file on disk. | 40 | * Switch loaders to debug mode. |
68 | * IMPORTANT: You must not specify an absolute path here! | ||
69 | * | 41 | * |
70 | * See: http://webpack.github.io/docs/configuration.html#output-filename | 42 | * See: http://webpack.github.io/docs/configuration.html#debug |
71 | */ | 43 | */ |
72 | filename: '[name].bundle.js', | 44 | debug: true, |
73 | 45 | ||
74 | /** | 46 | /** |
75 | * The filename of the SourceMaps for the JavaScript files. | 47 | * Developer tool to enhance debugging |
76 | * They are inside the output.path directory. | ||
77 | * | 48 | * |
78 | * See: http://webpack.github.io/docs/configuration.html#output-sourcemapfilename | 49 | * See: http://webpack.github.io/docs/configuration.html#devtool |
50 | * See: https://github.com/webpack/docs/wiki/build-performance#sourcemaps | ||
79 | */ | 51 | */ |
80 | sourceMapFilename: '[name].map', | 52 | devtool: 'cheap-module-source-map', |
81 | 53 | ||
82 | /** The filename of non-entry chunks as relative path | 54 | /** |
83 | * inside the output.path directory. | 55 | * Options affecting the output of the compilation. |
84 | * | 56 | * |
85 | * See: http://webpack.github.io/docs/configuration.html#output-chunkfilename | 57 | * See: http://webpack.github.io/docs/configuration.html#output |
86 | */ | 58 | */ |
87 | chunkFilename: '[id].chunk.js', | 59 | output: { |
60 | /** | ||
61 | * The output directory as absolute path (required). | ||
62 | * | ||
63 | * See: http://webpack.github.io/docs/configuration.html#output-path | ||
64 | */ | ||
65 | path: helpers.root('dist'), | ||
66 | |||
67 | /** | ||
68 | * Specifies the name of each output file on disk. | ||
69 | * IMPORTANT: You must not specify an absolute path here! | ||
70 | * | ||
71 | * See: http://webpack.github.io/docs/configuration.html#output-filename | ||
72 | */ | ||
73 | filename: '[name].bundle.js', | ||
74 | |||
75 | /** | ||
76 | * The filename of the SourceMaps for the JavaScript files. | ||
77 | * They are inside the output.path directory. | ||
78 | * | ||
79 | * See: http://webpack.github.io/docs/configuration.html#output-sourcemapfilename | ||
80 | */ | ||
81 | sourceMapFilename: '[name].map', | ||
82 | |||
83 | /** The filename of non-entry chunks as relative path | ||
84 | * inside the output.path directory. | ||
85 | * | ||
86 | * See: http://webpack.github.io/docs/configuration.html#output-chunkfilename | ||
87 | */ | ||
88 | chunkFilename: '[id].chunk.js', | ||
89 | |||
90 | library: 'ac_[name]', | ||
91 | libraryTarget: 'var' | ||
88 | 92 | ||
89 | library: 'ac_[name]', | 93 | }, |
90 | libraryTarget: 'var' | ||
91 | 94 | ||
92 | }, | 95 | externals: { |
96 | webtorrent: 'WebTorrent' | ||
97 | }, | ||
93 | 98 | ||
94 | externals: { | 99 | plugins: [ |
95 | webtorrent: 'WebTorrent' | 100 | |
96 | }, | 101 | /** |
102 | * Plugin: DefinePlugin | ||
103 | * Description: Define free variables. | ||
104 | * Useful for having development builds with debug logging or adding global constants. | ||
105 | * | ||
106 | * Environment helpers | ||
107 | * | ||
108 | * See: https://webpack.github.io/docs/list-of-plugins.html#defineplugin | ||
109 | */ | ||
110 | // NOTE: when adding more properties, make sure you include them in custom-typings.d.ts | ||
111 | new DefinePlugin({ | ||
112 | 'ENV': JSON.stringify(METADATA.ENV), | ||
113 | 'HMR': METADATA.HMR, | ||
114 | 'process.env': { | ||
115 | 'ENV': JSON.stringify(METADATA.ENV), | ||
116 | 'NODE_ENV': JSON.stringify(METADATA.ENV), | ||
117 | 'HMR': METADATA.HMR | ||
118 | } | ||
119 | }), | ||
97 | 120 | ||
98 | plugins: [ | 121 | new NamedModulesPlugin() |
122 | ], | ||
99 | 123 | ||
100 | /** | 124 | /** |
101 | * Plugin: DefinePlugin | 125 | * Static analysis linter for TypeScript advanced options configuration |
102 | * Description: Define free variables. | 126 | * Description: An extensible linter for the TypeScript language. |
103 | * Useful for having development builds with debug logging or adding global constants. | ||
104 | * | ||
105 | * Environment helpers | ||
106 | * | 127 | * |
107 | * See: https://webpack.github.io/docs/list-of-plugins.html#defineplugin | 128 | * See: https://github.com/wbuchwalter/tslint-loader |
108 | */ | 129 | */ |
109 | // NOTE: when adding more properties, make sure you include them in custom-typings.d.ts | 130 | tslint: { |
110 | new DefinePlugin({ | 131 | emitErrors: false, |
111 | 'ENV': JSON.stringify(METADATA.ENV), | 132 | failOnHint: false, |
112 | 'HMR': METADATA.HMR, | 133 | resourcePath: 'src' |
113 | 'process.env': { | ||
114 | 'ENV': JSON.stringify(METADATA.ENV), | ||
115 | 'NODE_ENV': JSON.stringify(METADATA.ENV), | ||
116 | 'HMR': METADATA.HMR | ||
117 | } | ||
118 | }), | ||
119 | |||
120 | new NamedModulesPlugin() | ||
121 | ], | ||
122 | |||
123 | /** | ||
124 | * Static analysis linter for TypeScript advanced options configuration | ||
125 | * Description: An extensible linter for the TypeScript language. | ||
126 | * | ||
127 | * See: https://github.com/wbuchwalter/tslint-loader | ||
128 | */ | ||
129 | tslint: { | ||
130 | emitErrors: false, | ||
131 | failOnHint: false, | ||
132 | resourcePath: 'src' | ||
133 | }, | ||
134 | |||
135 | devServer: { | ||
136 | port: METADATA.port, | ||
137 | host: METADATA.host, | ||
138 | historyApiFallback: true, | ||
139 | watchOptions: { | ||
140 | aggregateTimeout: 300, | ||
141 | poll: 1000 | ||
142 | }, | 134 | }, |
143 | outputPath: helpers.root('dist') | ||
144 | }, | ||
145 | |||
146 | /* | ||
147 | * Include polyfills or mocks for various node stuff | ||
148 | * Description: Node configuration | ||
149 | * | ||
150 | * See: https://webpack.github.io/docs/configuration.html#node | ||
151 | */ | ||
152 | node: { | ||
153 | global: 'window', | ||
154 | crypto: 'empty', | ||
155 | process: true, | ||
156 | module: false, | ||
157 | clearImmediate: false, | ||
158 | setImmediate: false | ||
159 | } | ||
160 | 135 | ||
161 | }) | 136 | devServer: { |
137 | port: METADATA.port, | ||
138 | host: METADATA.host, | ||
139 | historyApiFallback: true, | ||
140 | watchOptions: { | ||
141 | aggregateTimeout: 300, | ||
142 | poll: 1000 | ||
143 | }, | ||
144 | outputPath: helpers.root('dist') | ||
145 | }, | ||
146 | |||
147 | /* | ||
148 | * Include polyfills or mocks for various node stuff | ||
149 | * Description: Node configuration | ||
150 | * | ||
151 | * See: https://webpack.github.io/docs/configuration.html#node | ||
152 | */ | ||
153 | node: { | ||
154 | global: 'window', | ||
155 | crypto: 'empty', | ||
156 | process: true, | ||
157 | module: false, | ||
158 | clearImmediate: false, | ||
159 | setImmediate: false | ||
160 | } | ||
161 | }) | ||
162 | } | ||
diff --git a/client/package.json b/client/package.json index 94b028ffd..629723b54 100644 --- a/client/package.json +++ b/client/package.json | |||
@@ -37,16 +37,17 @@ | |||
37 | "angular2-template-loader": "^0.5.0", | 37 | "angular2-template-loader": "^0.5.0", |
38 | "assets-webpack-plugin": "^3.4.0", | 38 | "assets-webpack-plugin": "^3.4.0", |
39 | "awesome-typescript-loader": "^2.2.1", | 39 | "awesome-typescript-loader": "^2.2.1", |
40 | "bootstrap-loader": "^1.0.8", | 40 | "bootstrap-loader": "^2.0.0-beta.11", |
41 | "bootstrap-sass": "^3.3.6", | 41 | "bootstrap-sass": "^3.3.6", |
42 | "compression-webpack-plugin": "^0.3.1", | 42 | "compression-webpack-plugin": "^0.3.1", |
43 | "copy-webpack-plugin": "^3.0.1", | 43 | "copy-webpack-plugin": "^3.0.1", |
44 | "core-js": "^2.4.1", | 44 | "core-js": "^2.4.1", |
45 | "css-loader": "^0.25.0", | 45 | "css-loader": "^0.25.0", |
46 | "css-to-string-loader": "^0.1.1", | 46 | "css-to-string-loader": "https://github.com/Chocobozzz/css-to-string-loader#patch-1", |
47 | "es6-promise": "^3.0.2", | 47 | "es6-promise": "^3.0.2", |
48 | "es6-promise-loader": "^1.0.1", | 48 | "es6-promise-loader": "^1.0.1", |
49 | "es6-shim": "^0.35.0", | 49 | "es6-shim": "^0.35.0", |
50 | "extract-text-webpack-plugin": "^2.0.0-beta.4", | ||
50 | "file-loader": "^0.9.0", | 51 | "file-loader": "^0.9.0", |
51 | "html-webpack-plugin": "^2.19.0", | 52 | "html-webpack-plugin": "^2.19.0", |
52 | "ie-shim": "^0.1.0", | 53 | "ie-shim": "^0.1.0", |
@@ -69,7 +70,7 @@ | |||
69 | "tslint-loader": "^2.1.4", | 70 | "tslint-loader": "^2.1.4", |
70 | "typescript": "^2.0.0", | 71 | "typescript": "^2.0.0", |
71 | "url-loader": "^0.5.7", | 72 | "url-loader": "^0.5.7", |
72 | "webpack": "^2.1.0-beta.21", | 73 | "webpack": "2.1.0-beta.22", |
73 | "webpack-md5-hash": "0.0.5", | 74 | "webpack-md5-hash": "0.0.5", |
74 | "webpack-merge": "^0.14.1", | 75 | "webpack-merge": "^0.14.1", |
75 | "webpack-notifier": "^1.3.0", | 76 | "webpack-notifier": "^1.3.0", |
diff --git a/server/middlewares/oauth.js b/server/middlewares/oauth.js index 91a990509..08584c41c 100644 --- a/server/middlewares/oauth.js +++ b/server/middlewares/oauth.js | |||
@@ -23,7 +23,7 @@ function authenticate (req, res, next) { | |||
23 | return res.sendStatus(500) | 23 | return res.sendStatus(500) |
24 | } | 24 | } |
25 | 25 | ||
26 | if (res.statusCode === 401 || res.statusCode === 400) return res.end() | 26 | if (res.statusCode === 401 || res.statusCode === 400 || res.statusCode === 503) return res.end() |
27 | 27 | ||
28 | return next() | 28 | return next() |
29 | }) | 29 | }) |
diff --git a/server/tests/api/check-params.js b/server/tests/api/check-params.js index a696bc171..57b5ca024 100644 --- a/server/tests/api/check-params.js +++ b/server/tests/api/check-params.js | |||
@@ -697,13 +697,6 @@ describe('Test parameters validator', function () { | |||
697 | .set('Authorization', 'Bearer ' + server.accessToken) | 697 | .set('Authorization', 'Bearer ' + server.accessToken) |
698 | .expect(404, done) | 698 | .expect(404, done) |
699 | }) | 699 | }) |
700 | |||
701 | it('Should success with the correct parameters', function (done) { | ||
702 | request(server.url) | ||
703 | .delete(path + userId) | ||
704 | .set('Authorization', 'Bearer ' + server.accessToken) | ||
705 | .expect(204, done) | ||
706 | }) | ||
707 | }) | 700 | }) |
708 | }) | 701 | }) |
709 | 702 | ||