Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit671da82

Browse files
author
Filip Hric
committed
add the ability to change app port
1 parent216afab commit671da82

File tree

5 files changed

+24
-8
lines changed

5 files changed

+24
-8
lines changed

‎.env_example‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,7 @@ VUE_APP_GOOGLE_CLIENT_SECRET=""
44
# enable or disable google SSO for the trello application
55
VUE_APP_GOOGLE_ENABLED=""
66
# token generated by google oauth playground, this is a token of a user you want to log in to the app
7-
GOOGLE_REFRESH_TOKEN=""
7+
GOOGLE_REFRESH_TOKEN=""
8+
# ports on which should the trello app run these are default values and don’t need to be explicitly set
9+
APP="3000"
10+
SERVER="3001"

‎backend/index.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import userRoutes from './api/user-routes';
77
importloginRoutesfrom'./api/login-routes';
88
importsignupRoutesfrom'./api/signup-routes';
99
importlocationRoutesfrom'./api/location-routes';
10+
importconstantsfrom'../constants';
11+
const{SERVER}=constants
1012

1113
exportconststartServer=():PluginOption=>{
1214

@@ -42,7 +44,7 @@ export const startServer = (): PluginOption => {
4244

4345
app.use(router);
4446

45-
constserver=app.listen(3001);
47+
constserver=app.listen(SERVER);
4648
// const io = require('socket.io')(server);
4749

4850
// io.on('connection', (socket) => {

‎constants.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import'dotenv/config'
2+
exportdefault{
3+
APP:parseInt(process.env.APPasstring)||3000,
4+
SERVER:parseInt(process.env.SERVERasstring)||3001
5+
}

‎cypress.config.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import{defineConfig}from'cypress'
2+
importconstantsfrom'./constants'
3+
const{APP}=constants
24

35
exportdefaultdefineConfig({
46
env:{
@@ -18,15 +20,15 @@ export default defineConfig({
1820
setupNodeEvents(on,config){
1921
returnrequire('./cypress/plugins/index.ts')(on,config)
2022
},
21-
baseUrl:'http://localhost:3000',
23+
baseUrl:`http://localhost:${APP}`,
2224
specPattern:'cypress/e2e/**/*.spec.ts',
2325
},
2426
component:{
2527
devServer:{
2628
framework:'vue',
2729
bundler:'vite',
2830
},
29-
setupNodeEvents(on,config){},
31+
setupNodeEvents(on,config){},
3032
env:{
3133
coverage:false,
3234
},

‎vite.config.ts‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ import svgLoader from 'vite-svg-loader';
55
importvuefrom'@vitejs/plugin-vue';
66
importpluginEnvfrom'vite-plugin-vue-env';
77
importtsconfigPathsfrom'vite-tsconfig-paths'
8+
importconstantsfrom'./constants'
9+
10+
const{APP,SERVER}=constants
811

912
exportdefaultdefineConfig({
1013
define:{
@@ -16,23 +19,24 @@ export default defineConfig({
1619
pluginEnv(),
1720
istanbul({
1821
exclude:['node_modules','test/'],
19-
extension:['.js','.ts','.vue'],
22+
extension:['.js','.ts','.vue'],
2023
include:'src/*',
2124
cypress:true
2225
}),
2326
createServer(),
24-
tsconfigPaths({extensions:['.ts','.d.ts']})
27+
tsconfigPaths({extensions:['.ts','.d.ts']})
2528
],
2629
server:{
30+
port:APP,
2731
proxy:{
2832
'^/api/.*':{
2933
changeOrigin:true,
3034
rewrite:path=>path.replace(/^\/api/,''),
31-
target:'http://localhost:3001'
35+
target:`http://localhost:${SERVER}`
3236
},
3337
'^/socket.io/.*':{
3438
changeOrigin:true,
35-
target:'http://localhost:3001',
39+
target:`http://localhost:${SERVER}`,
3640
}
3741
}
3842
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp