Update dev port to 3000

This commit is contained in:
Matthias 2022-02-05 20:13:18 +01:00
parent f2574b8b6e
commit ca7b9efcb1
11 changed files with 21 additions and 39 deletions

View File

@ -16,4 +16,4 @@ RUN mkdir -p ${HOME}/commandhistory \
&& echo "export PROMPT_COMMAND='history -a'" >> ${HOME}/.bashrc \ && echo "export PROMPT_COMMAND='history -a'" >> ${HOME}/.bashrc \
&& echo "export HISTFILE=~/commandhistory/.bash_history" >> ${HOME}/.bashrc && echo "export HISTFILE=~/commandhistory/.bash_history" >> ${HOME}/.bashrc
EXPOSE 8080 EXPOSE 3000

View File

@ -5,7 +5,7 @@
"dockerfile": "Dockerfile" "dockerfile": "Dockerfile"
}, },
"forwardPorts": [ "forwardPorts": [
8080 3000
], ],
"mounts": [ "mounts": [
"source=frequi-bashhistory,target=/home/node/commandhistory,type=volume" "source=frequi-bashhistory,target=/home/node/commandhistory,type=volume"

View File

@ -47,7 +47,7 @@ jobs:
with: with:
# build: yarn build # build: yarn build
start: yarn serve start: yarn serve
wait-on: 'http://localhost:8080' wait-on: 'http://localhost:3000'
- name: Build build - name: Build build
run: yarn build run: yarn build

View File

@ -16,10 +16,10 @@ Instructions for this end-user setup can be found in the [freqtrade API document
## Developer project setup ## 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). 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. Ports can vary, so check the URL you're using.
### Project setup ### Project setup
@ -52,7 +52,7 @@ yarn lint
docker-compose build docker-compose build
docker-compose up -d docker-compose up -d
# Access using http://localhost:8080/ # Access using http://localhost:3000/
``` ```

View File

@ -1,3 +0,0 @@
module.exports = {
presets: ['@babel/preset-env'],
};

View File

@ -1,6 +1,6 @@
{ {
"testFiles": "**/*.spec.ts", "testFiles": "**/*.spec.ts",
"baseUrl": "http://localhost:8080", "baseUrl": "http://localhost:3000",
"video": false, "video": false,
"component": { "component": {
"componentFolder": "src" "componentFolder": "src"

View File

@ -6,7 +6,7 @@ describe('Login', () => {
cy.get('button').contains('Login').click(); cy.get('button').contains('Login').click();
cy.get('.modal-title').contains('Login to your bot'); cy.get('.modal-title').contains('Login to your bot');
// Test prefilled URL // 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('#name-input').should('exist');
cy.get('#username-input').should('exist'); cy.get('#username-input').should('exist');
cy.get('#password-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('li').should('contain', 'No bot selected');
cy.get('.card-header').contains('Freqtrade bot Login'); cy.get('.card-header').contains('Freqtrade bot Login');
// Test prefilled URL // 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=name-input]').should('exist');
cy.get('input[id=username-input]').should('exist'); cy.get('input[id=username-input]').should('exist');
cy.get('input[id=password-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].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].accessToken).to.eq('access_token_tesst');
expect(loginInfo[bot1].refreshToken).to.eq('refresh_test'); expect(loginInfo[bot1].refreshToken).to.eq('refresh_test');
}); });

View File

@ -9,4 +9,4 @@ services:
# image: freqtradeorg/frequi:main # image: freqtradeorg/frequi:main
restart: unless-stopped restart: unless-stopped
ports: ports:
- "8080:80" - "3000:80"

View File

@ -80,7 +80,7 @@ import { AuthPayload, BotDescriptor } from '@/types';
import { MultiBotStoreGetters } from '@/store/modules/botStoreWrapper'; import { MultiBotStoreGetters } from '@/store/modules/botStoreWrapper';
import StoreModules from '@/store/storeSubModules'; 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); const ftbot = namespace(StoreModules.ftbot);
@Component({}) @Component({})

View File

@ -5,10 +5,6 @@ import { resolve } from 'path';
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig({ export default defineConfig({
plugins: [createVuePlugin()], plugins: [createVuePlugin()],
server: {
host: 'localhost',
port: 8080,
},
resolve: { resolve: {
alias: [ alias: [
{ {
@ -19,6 +15,7 @@ export default defineConfig({
}, },
build: { build: {
chunkSizeWarningLimit: 700, // Default is 500 chunkSizeWarningLimit: 700, // Default is 500
sourcemap: true,
}, },
css: { css: {
preprocessorOptions: { preprocessorOptions: {
@ -27,4 +24,12 @@ export default defineConfig({
}, },
}, },
}, },
server: {
proxy: {
'/api': {
target: 'http://127.0.0.1:8080',
changeOrigin: true,
},
},
},
}); });

View File

@ -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";',
},
},
},
};