server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html index.htm;
server_name _;
location / {
return 503;
}
location /api/ {
proxy_pass http://localhost:5000; #whatever port your app runs on
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/errors;
}
}
{
"compilerOptions": {
"outDir": "./src/assets/js/index.ts",
"sourceMap": true,
"module": "es6",
"target": "es5"
}
}
module.exports = {
entry: {
index: './src/assets/js/index.ts',
// devtool: 'inline-source-map',
},
module: {
rules: [{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/
},
{
test: /.(ttf|otf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/,
use: [{
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: 'fonts/',
publicPath: '../fonts/',
},
}],
},
],
},
resolve: {
extensions: [ '.tsx', '.ts', '.js' ]
},
output: {
filename: 'js/[name].js',
path: path.resolve(__dirname, 'build'),
},
plugins: [
new CleanWebpackPlugin(),
new ExtractTextPlugin('./css/[name].css'),
...db.map((o) => {
return new HtmlWebpackPlugin({
template: `ejs-compiled-loader!${path.resolve(dirTemplates, `${o.filename}.ejs`)}`,
chunks: ['index', 'common'],
filename: `${o.filename}.html`,
title: o.title,
});
}),
],
};