Skip to content

Commit

Permalink
add translate
Browse files Browse the repository at this point in the history
  • Loading branch information
sherylynn committed Nov 11, 2018
1 parent fe5e66c commit 3c71c64
Show file tree
Hide file tree
Showing 7 changed files with 4,236 additions and 4,186 deletions.
10 changes: 10 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -1126,6 +1126,9 @@ gulp.task('server', function (done) {
});
var connect = require('gulp-connect');
var proxy = require('http-proxy-middleware');
let translate_url = 'http://api.fanyi.baidu.com/api/trans/vip/translate';
//let self_config =require('./config.js')
//import { config as self_config } from './config.js';
gulp.task('cor', function () {
connect.server({
root: '',
Expand All @@ -1140,6 +1143,13 @@ gulp.task('cor', function () {
'^/db': '',
},
}),
proxy(['/trans'], {
target: translate_url, // input url of your db
changeOrigin: true,
pathRewrite: {
'^/trans': '',
},
}),
proxy(['/pdf'], {
target: 'http://127.0.0.1:7777',
changeOrigin: true,
Expand Down
Loading

0 comments on commit 3c71c64

Please sign in to comment.