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
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commitfdc6a2e

Browse files
committed
build: clean up
1 parentf82c089 commitfdc6a2e

File tree

5 files changed

+22
-18
lines changed

5 files changed

+22
-18
lines changed

‎config/endpoint.js‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
constgetGraphQLEndpoint=()=>{
44
switch(process.env.GOAL){
55
case'production':
6-
return'http://localhost:4001/graphiql'
7-
/* return 'http://api.coderplanets.com/graphiql' */
6+
return'http://api.coderplanets.com/graphiql'
87

98
case'dev':
109
return'http://devapi.coderplanets.com/graphiql'
@@ -17,5 +16,7 @@ const getGraphQLEndpoint = () => {
1716
}
1817
}
1918
exportconstGRAPHQL_ENDPOINT=getGraphQLEndpoint()
20-
exportconstISSUE_ADDR='https://github.com/mydearxym/mastani_web/issues/new'
19+
exportconstGITHUB_ADDR='https://github.com/coderplanets/coderplanets_admin'
20+
exportconstGITHUB_ME='https://github.com/mydearxym'
21+
exportconstISSUE_ADDR=`${GITHUB_ADDR}/issues/new`
2122
exportconstMENTION_USER_ADDR='https://coderplanets.com/users/'

‎deploy/dev/loader.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
cd /root/web/
44
# npm run launch:dev &
5-
pm2-runtime start npm --name"coderplanets_web" -- run launch:dev&
5+
pm2-runtime start npm --name"coderplanets_admin" -- run launch:dev&
66

77
whiletrue
88
do

‎deploy/production/loader.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
cd /root/web/
44

5-
pm2-runtime start npm --name"coderplanets_web" -- run launch&
5+
pm2-runtime start npm --name"coderplanets_admin" -- run launch&
66

77
whiletrue
88
do

‎package.json‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@
1010
"lint:watch":"esw -w pages/**/*.js components/**/* containers/**/* stores/**/*",
1111
"server":"npm run clean && node server.js",
1212
"build":"run-s dist clean",
13-
"build:only":"npm run i18n && next build",
14-
"next-start":"cross-env GOAL=production next build && cross-env GOAL=production next start -p 3002",
15-
"build:dev":"cross-env GOAL=dev run-s dist:dev clean",
13+
"build:clean":"run-s dist clean",
14+
"build:with18n":"npm run i18n && next build",
15+
"build:prod":"cross-env GOAL=production next build",
16+
"build:dev":"cross-env GOAL=dev next build",
17+
"launch":"cross-env GOAL=production next start -p ${SERVE_PORT}",
18+
"launch:dev":"cross-env GOAL=dev next start -p ${SERVE_PORT}",
1619
"dist":"npm run i18n && next build && next export -o\"build\"",
1720
"i18n":"shjs ./utils/scripts/create_default_lang.js && shjs ./utils/scripts/cp_locales.js",
1821
"start":"cross-env goal=production node server.js",

‎server.js‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const { basename } = require('path')
99
constaccepts=require('accepts')
1010
constglob=require('glob')
1111

12-
constapp=next({ dev})
12+
constapp=next({ dev,quiet:false})
1313
consthandle=app.getRequestHandler()
1414
constroute=pathMatch()
1515
constSERVE_PORT=3001
@@ -57,7 +57,6 @@ const communityQuery = route('/:main/:sub?')
5757
app.prepare().then(()=>{
5858
createServer((req,res)=>{
5959
consturlParts=parse(req.url,true)
60-
/* const { pathname } = parse(req.url) */
6160
const{ pathname, query}=urlParts
6261

6362
constaccept=accepts(req)
@@ -66,22 +65,23 @@ app.prepare().then(() => {
6665
if(localeQuery(pathname)){
6766
res.setHeader('Content-Type','application/json;charset=utf-8')
6867
returnres.end(JSON.stringify(getMessages(localeQuery(pathname).lang)))
69-
}elseif(communitiesQuery(pathname)){
70-
console.log('on server communities')
71-
returnapp.render(req,res,'/communities',query)
72-
}elseif(usersQuery(pathname)){
73-
returnapp.render(req,res,'/users',query)
74-
}elseif(communityQuery(pathname)){
75-
returnapp.render(req,res,'/',query)
7668
}
7769

70+
// community page
71+
if(communityQuery(pathname))returnapp.render(req,res,'/',query)
72+
// users page
73+
if(usersQuery(pathname))returnapp.render(req,res,'/users',query)
74+
// communities page
75+
if(communitiesQuery(pathname))
76+
returnapp.render(req,res,'/communities',query)
77+
7878
// now index page go this way
7979
req.locale=locale
8080
req.messages=getMessages(locale)
8181

8282
returnhandle(req,res)
8383
}).listen(SERVE_PORT,err=>{
8484
if(err)throwerr
85-
console.log('> Ready on http://localhost:3001')
85+
console.log(`> Ready on http://localhost:${SERVE_PORT}`)
8686
})
8787
})

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp