diff options
author | Vitaly Takmazov | 2024-10-10 23:37:53 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2024-10-10 23:37:53 +0300 |
commit | 641c5b59ead5a741ae4b6c785f861619ba0aa340 (patch) | |
tree | 11687521c90d75390823cf80b06d0513d0e269aa | |
parent | 357657df86dd0af590656bd5f9f545b0749ba8bb (diff) |
`bridge` is not used anymore
-rw-r--r-- | bridge/Dockerfile | 14 | ||||
-rw-r--r-- | bridge/ecosystem.config.js | 12 | ||||
-rw-r--r-- | bridge/index.js | 25 | ||||
-rw-r--r-- | bridge/webpack.config.js | 70 | ||||
-rw-r--r-- | package-lock.json | 14 | ||||
-rw-r--r-- | package.json | 5 |
6 files changed, 9 insertions, 131 deletions
diff --git a/bridge/Dockerfile b/bridge/Dockerfile deleted file mode 100644 index ef79431f..00000000 --- a/bridge/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM keymetrics/pm2:18-alpine - -# Bundle APP files -COPY public/bridge.js . -COPY bridge/ecosystem.config.js . - -# Install app dependencies -ENV NPM_CONFIG_LOGLEVEL warn -ENV DEBUG http - -# Expose the listening port of your app -EXPOSE 8081 - -CMD [ "pm2-runtime", "start", "ecosystem.config.js", "--env", "production" ] diff --git a/bridge/ecosystem.config.js b/bridge/ecosystem.config.js deleted file mode 100644 index 40073998..00000000 --- a/bridge/ecosystem.config.js +++ /dev/null @@ -1,12 +0,0 @@ -module.exports = { - apps : [{ - name: 'bridge', - script: './bridge.js', - env: { - NODE_ENV: 'development', - }, - env_production: { - NODE_ENV: 'production', - } - }] - } diff --git a/bridge/index.js b/bridge/index.js deleted file mode 100644 index 727bd395..00000000 --- a/bridge/index.js +++ /dev/null @@ -1,25 +0,0 @@ -import express from 'express' -import { raw } from 'body-parser' -import cors from 'cors' -import debug from 'debug' -const log = debug('http') - -import oembed from '../vnext/server/middleware/oembed' - -const app = express() -app.use(raw()) -app.use(cors()) -const router = express.Router() - -router.get('/oembed', oembed) - -app.use(router) - -const PORT = 8081 -// start the app -app.listen(PORT, (error) => { - if (error) { - return console.log('something bad happened', error) - } - log('listening on ' + PORT + '...') -}) diff --git a/bridge/webpack.config.js b/bridge/webpack.config.js deleted file mode 100644 index 9467224d..00000000 --- a/bridge/webpack.config.js +++ /dev/null @@ -1,70 +0,0 @@ -const ESLintPlugin = require('eslint-webpack-plugin') -const TerserPlugin = require('terser-webpack-plugin') - -module.exports = () => { - const node_env = process.env.NODE_ENV ? process.env.NODE_ENV : 'development' - const dev = node_env !== 'production' - const config = { - mode: node_env, - devtool: dev ? 'cheap-module-source-map' : false, - entry: { - 'bridge': [ - __dirname + '/index.js' - ] - }, - target: 'node', - output: { - path: __dirname + '/../public', - filename: '[name].js' - }, - module: { - rules: [{ - test: /\.js$/, - exclude: [ - /node_modules/ - ], - loader: 'babel-loader' - }, { - test: /\.(png|jpe?g|gif|svg)$/i, - type: 'asset/resource' - }] - }, - plugins: [ - ], - resolve: { - symlinks: false, - extensions: ['.js'] - } - } - if (dev) { - config.plugins.push( - new ESLintPlugin({ - files: __dirname + '/src', - lintDirtyModulesOnly: true, - failOnWarning: false, - failOnError: true, - fix: false - })) - config.devServer = { - hot: true, - historyApiFallback: true, - client: { - overlay: { - runtimeErrors: true - } - } - } - } - config.optimization = { - minimize: !dev, - minimizer: [ - new TerserPlugin({ - minify: TerserPlugin.swcMinify, - // `terserOptions` options will be passed to `swc` (`@swc/core`) - // Link to options - https://swc.rs/docs/config-js-minify - terserOptions: {}, - }), - ] - } - return config -} diff --git a/package-lock.json b/package-lock.json index fd10761a..29ac484f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7523,9 +7523,9 @@ "dev": true }, "node_modules/cookie": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", - "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", "engines": { "node": ">= 0.6" } @@ -9850,16 +9850,16 @@ } }, "node_modules/express": { - "version": "4.21.0", - "resolved": "https://registry.npmjs.org/express/-/express-4.21.0.tgz", - "integrity": "sha512-VqcNGcj/Id5ZT1LZ/cfihi3ttTn+NJmkli2eZADigjq29qTlWi/hAQ43t/VLPq8+UX06FCEx3ByOYet6ZFblng==", + "version": "4.21.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz", + "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.6.0", + "cookie": "0.7.1", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", diff --git a/package.json b/package.json index b259da74..9572e8dc 100644 --- a/package.json +++ b/package.json @@ -7,11 +7,10 @@ "compile": "webpack --mode production", "lint": "eslint src/main/assets", "vnext:build": "webpack -c vnext/webpack.config.js --mode production --progress", - "vnext:build:ssr": "npm run vnext:build && webpack -c vnext/server/webpack.config.js --mode production", + "vnext:build:ssr": "npm run vnext:build && webpack -c vnext/server/webpack.config.js --mode production && docker build -f vnext/server/Dockerfile . -t \"ghcr.io/juick/vnext\"", "vnext:start-ssr": "npm run vnext:build && webpack -c vnext/server/webpack.config.js --mode development && cross-env DEBUG=http node --enable-source-maps public/server.js", "vnext:start": "webpack serve -c vnext/webpack.config.js --mode development", - "vnext:lint": "eslint vnext", - "bridge:build": "webpack -c bridge/webpack.config.js --mode production" + "vnext:lint": "eslint vnext" }, "repository": { "type": "git", |