Skip to content

Commit 1d76666

Browse files
committed
Adds redirects for register and login
1 parent de09c3f commit 1d76666

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

src/app.ts

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import accessKeys from './routes/accessKeys'
99
import account from './routes/account'
1010
import users from './routes/users'
1111
import apps from './routes/apps'
12+
import redirects from './routes/redirects'
1213
import log4js from 'log4js'
1314
import dotenv from 'dotenv'
1415
import * as middleware from "./core/middleware"
@@ -76,6 +77,7 @@ if (_.get(config, 'common.storageType') === 'local') {
7677
}
7778

7879
app.use('/', routes);
80+
app.use('/', redirects);
7981
app.use('/auth', auth);
8082
app.use('/accessKeys', middleware.checkToken, accessKeys);
8183
app.use('/account', middleware.checkToken, account);

src/core/config.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ export default {
4646
*/
4747
tryLoginTimes: 3,
4848
// CodePush Web(https://github.com/lisong/code-push-web) login address.
49-
// codePushWebUrl: "http://127.0.0.1:3001",
50-
codePushWebUrl: "http://localhost:5000",
49+
codePushWebUrl: "http://localhost:3000",
5150
// create patch updates's number. default value is 3
5251
diffNums: 3,
5352
// data dir for caclulate diff files. it's optimization.

src/routes/redirects.ts

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
import config from '~/core/config';
3+
import validationRouter from '~/core/router'
4+
5+
const router = validationRouter()
6+
7+
router.get('/login', (req, res) => {
8+
const codePushWebUrl = config.common.codePushWebUrl
9+
res.redirect(`${codePushWebUrl}/auth/login`);
10+
});
11+
12+
router.get('/register', (req, res) => {
13+
const codePushWebUrl = config.common.codePushWebUrl
14+
res.redirect(`${codePushWebUrl}/register`);
15+
});
16+
17+
export default router

0 commit comments

Comments
 (0)