From ca7b9efcb1d39b6a00ce2256b6549edc3e43cbaf Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 5 Feb 2022 20:13:18 +0100 Subject: [PATCH] Update dev port to 3000 --- .devcontainer/Dockerfile | 2 +- .devcontainer/devcontainer.json | 2 +- .github/workflows/ci.yml | 2 +- README.md | 6 +++--- babel.config.js | 3 --- cypress.json | 2 +- cypress/integration/login.spec.ts | 6 +++--- docker-compose.yml | 2 +- src/components/Login.vue | 2 +- vite.config.js | 13 +++++++++---- vue.config.js | 20 -------------------- 11 files changed, 21 insertions(+), 39 deletions(-) delete mode 100644 babel.config.js delete mode 100644 vue.config.js diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 2d9e739b..1123ec95 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -16,4 +16,4 @@ RUN mkdir -p ${HOME}/commandhistory \ && echo "export PROMPT_COMMAND='history -a'" >> ${HOME}/.bashrc \ && echo "export HISTFILE=~/commandhistory/.bash_history" >> ${HOME}/.bashrc -EXPOSE 8080 +EXPOSE 3000 diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index ca3beeae..8ce5f196 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -5,7 +5,7 @@ "dockerfile": "Dockerfile" }, "forwardPorts": [ - 8080 + 3000 ], "mounts": [ "source=frequi-bashhistory,target=/home/node/commandhistory,type=volume" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d943f677..04d5dbf6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,7 @@ jobs: with: # build: yarn build start: yarn serve - wait-on: 'http://localhost:8080' + wait-on: 'http://localhost:3000' - name: Build build run: yarn build diff --git a/README.md b/README.md index 5c1ee167..5e2ac24f 100644 --- a/README.md +++ b/README.md @@ -16,10 +16,10 @@ Instructions for this end-user setup can be found in the [freqtrade API document ## Developer project setup -It will require [freqtrade](https://github.com/freqtrade/freqtrade) to be running on the same host with the API enabled under (`localhost:8081`). You can either use the webpack proxy (port can be changed in `vue.config.js`) - or connect directly to the API (recommended). +It will require [freqtrade](https://github.com/freqtrade/freqtrade) to be running on the same host with the API enabled under (`localhost:8080`). You can either use the webpack proxy (port can be changed in `vue.config.js`) - or connect directly to the API (recommended). You will also have to have CORS for freqtrade configured correctly based on the [freqtrade documentation](https://www.freqtrade.io/en/latest/rest-api/#cors). -Most likely, the correct entry will be `http://localhost:8080` or `http://127.0.0.1:8080` - but the URL must match the URL you use to access FreqUI. +Most likely, the correct entry will be `http://localhost:3000` or `http://127.0.0.1:3000` - but the URL must match the URL you use to access FreqUI. Ports can vary, so check the URL you're using. ### Project setup @@ -52,7 +52,7 @@ yarn lint docker-compose build docker-compose up -d -# Access using http://localhost:8080/ +# Access using http://localhost:3000/ ``` diff --git a/babel.config.js b/babel.config.js deleted file mode 100644 index a79d1195..00000000 --- a/babel.config.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - presets: ['@babel/preset-env'], -}; diff --git a/cypress.json b/cypress.json index 0bb33e5d..6bd55d6c 100644 --- a/cypress.json +++ b/cypress.json @@ -1,6 +1,6 @@ { "testFiles": "**/*.spec.ts", - "baseUrl": "http://localhost:8080", + "baseUrl": "http://localhost:3000", "video": false, "component": { "componentFolder": "src" diff --git a/cypress/integration/login.spec.ts b/cypress/integration/login.spec.ts index 0cb6a00e..2630dae2 100644 --- a/cypress/integration/login.spec.ts +++ b/cypress/integration/login.spec.ts @@ -6,7 +6,7 @@ describe('Login', () => { cy.get('button').contains('Login').click(); cy.get('.modal-title').contains('Login to your bot'); // Test prefilled URL - cy.get('input[id=url-input]').should('have.value', 'http://localhost:8080'); + cy.get('input[id=url-input]').should('have.value', 'http://localhost:3000'); cy.get('#name-input').should('exist'); cy.get('#username-input').should('exist'); cy.get('#password-input').should('exist'); @@ -20,7 +20,7 @@ describe('Login', () => { cy.get('li').should('contain', 'No bot selected'); cy.get('.card-header').contains('Freqtrade bot Login'); // Test prefilled URL - cy.get('input[id=url-input]').should('have.value', 'http://localhost:8080'); + cy.get('input[id=url-input]').should('have.value', 'http://localhost:3000'); cy.get('input[id=name-input]').should('exist'); cy.get('input[id=username-input]').should('exist'); cy.get('input[id=password-input]').should('exist'); @@ -68,7 +68,7 @@ describe('Login', () => { expect(loginInfo[bot1].botName).to.eq('TestBot'); expect(loginInfo[bot1].botName).to.eq('TestBot'); - expect(loginInfo[bot1].apiUrl).to.eq('http://localhost:8080'); + expect(loginInfo[bot1].apiUrl).to.eq('http://localhost:3000'); expect(loginInfo[bot1].accessToken).to.eq('access_token_tesst'); expect(loginInfo[bot1].refreshToken).to.eq('refresh_test'); }); diff --git a/docker-compose.yml b/docker-compose.yml index 72a9b447..60eb58d1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,4 +9,4 @@ services: # image: freqtradeorg/frequi:main restart: unless-stopped ports: - - "8080:80" + - "3000:80" diff --git a/src/components/Login.vue b/src/components/Login.vue index a92f101c..5f19e4ba 100644 --- a/src/components/Login.vue +++ b/src/components/Login.vue @@ -80,7 +80,7 @@ import { AuthPayload, BotDescriptor } from '@/types'; import { MultiBotStoreGetters } from '@/store/modules/botStoreWrapper'; import StoreModules from '@/store/storeSubModules'; -const defaultURL = window.location.origin || 'http://localhost:8080'; +const defaultURL = window.location.origin || 'http://localhost:3000'; const ftbot = namespace(StoreModules.ftbot); @Component({}) diff --git a/vite.config.js b/vite.config.js index e268c105..0b68a944 100644 --- a/vite.config.js +++ b/vite.config.js @@ -5,10 +5,6 @@ import { resolve } from 'path'; // https://vitejs.dev/config/ export default defineConfig({ plugins: [createVuePlugin()], - server: { - host: 'localhost', - port: 8080, - }, resolve: { alias: [ { @@ -19,6 +15,7 @@ export default defineConfig({ }, build: { chunkSizeWarningLimit: 700, // Default is 500 + sourcemap: true, }, css: { preprocessorOptions: { @@ -27,4 +24,12 @@ export default defineConfig({ }, }, }, + server: { + proxy: { + '/api': { + target: 'http://127.0.0.1:8080', + changeOrigin: true, + }, + }, + }, }); diff --git a/vue.config.js b/vue.config.js deleted file mode 100644 index 9beeaa8d..00000000 --- a/vue.config.js +++ /dev/null @@ -1,20 +0,0 @@ -module.exports = { - configureWebpack: { - devtool: 'source-map', - }, - devServer: { - proxy: { - '/api': { - target: 'http://127.0.0.1:8081', - changeOrigin: true, - }, - }, - }, - css: { - loaderOptions: { - sass: { - additionalData: '@import "@/styles/_variables.scss";', - }, - }, - }, -};