Skip to content

Commit

Permalink
Revert "Chore/dot env" (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
lihuacai168 authored Jan 30, 2024
1 parent dc124f3 commit 65c5d08
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 15 deletions.
3 changes: 1 addition & 2 deletions web/build/webpack.dev.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,10 @@ module.exports = new Promise((resolve, reject) => {
// add port to devServer config
devWebpackConfig.devServer.port = port

const baseUrl = `http://${devWebpackConfig.devServer.host}:${port}`
// Add FriendlyErrorsPlugin
devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
compilationSuccessInfo: {
messages: [`Your application is running here: ${baseUrl}`],
messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}/fastrunner/login`],
},
onErrors: config.dev.notifyOnErrors
? utils.createNotifierCallback()
Expand Down
2 changes: 0 additions & 2 deletions web/config/dev.env.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
const merge = require('webpack-merge')
const prodEnv = require('./prod.env')
const FasterRunner = process.env.FasterRunner ? process.env.FasterRunner : "Another FasterRunner"
const API_URL = process.env.VUE_APP_API_URL ? process.env.VUE_APP_API_URL : ""
console.log("API_URL: " + API_URL)
module.exports = merge(prodEnv, {
NODE_ENV: '"development"',
FasterRunner: "'" + FasterRunner + "'"
Expand Down
3 changes: 1 addition & 2 deletions web/config/prod.env.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict'
require('dotenv').config()
const FasterRunner = process.env.FasterRunner ? process.env.FasterRunner : "Another FasterRunner"
const API_URL = process.env.VUE_APP_API_URL ? process.env.VUE_APP_API_URL : ""
const API_URL = process.env.API_URL ? process.env.API_URL : ""
console.log('process args: ' + process.argv)
console.log('get env from env API_URL: ' + API_URL)
module.exports = {
Expand Down
1 change: 0 additions & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"axios": "^0.18.0",
"babel-preset-es2015": "^6.24.1",
"brace": "^0.11.1",
"dotenv": "^16.4.1",
"element-ui": "2.15.13",
"sass-loader": "^11.0.1",
"v-jsoneditor": "^1.4.4",
Expand Down
4 changes: 1 addition & 3 deletions web/src/restful/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ import {Message} from 'element-ui';
// }

axios.defaults.withCredentials = true;
axios.defaults.baseURL = process.env.VUE_APP_API_URL || "http://localhost:8000";

console.log(`get env from .env VUE_APP_API_URL: ${JSON.stringify(process.env)}`)
// axios.defaults.baseURL = baseUrl;

const err_msg_duration = 2000 // ms

Expand Down
5 changes: 0 additions & 5 deletions web/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2546,11 +2546,6 @@ dot-prop@^5.2.0:
dependencies:
is-obj "^2.0.0"

dotenv@^16.4.1:
version "16.4.1"
resolved "https://registry.npmmirror.com/dotenv/-/dotenv-16.4.1.tgz#1d9931f1d3e5d2959350d1250efab299561f7f11"
integrity sha512-CjA3y+Dr3FyFDOAMnxZEGtnW9KBR2M0JvvUtXNW+dYJL5ROWxP9DUHCwgFqpMk0OXCc0ljhaNTr2w/kutYIcHQ==

duplexer@^0.1.2:
version "0.1.2"
resolved "https://registry.npmmirror.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6"
Expand Down

0 comments on commit 65c5d08

Please sign in to comment.