Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

最新版并不支持指定端口号 #10

Open
superzw opened this issue Mar 10, 2020 · 3 comments
Open

最新版并不支持指定端口号 #10

superzw opened this issue Mar 10, 2020 · 3 comments

Comments

@superzw
Copy link

superzw commented Mar 10, 2020

问题:执行yapi server --port 9290依然提示9090端口。
yapi-cli版本:1.5.0
问题版本代码:
src/commands/server.js文件中
` app.get('/api/base', async function (req, res) {

  let versions = await utils.getVersions();
  res.send({
    versions,
    root: path.resolve(process.cwd(), 'my-yapi')
  })

})
app.use(express.static(path.resolve(__dirname, './server')))
app.listen(9090)
console.log('在浏览器打开 http://0.0.0.0:9090 访问。非本地服务器,请将 0.0.0.0 替换成指定的域名或

ip ');`
写死了端口。

@aixfox
Copy link

aixfox commented Jul 24, 2020

+1
[email protected]

看了下 master 分支是有对应的改动的,可以发布一下吗。

@javin9
Copy link

javin9 commented Mar 23, 2021

安装完毕找到文件,直接修改端口号

@FantasyLeo
Copy link

支持一下,端口应该参数化配置的。看到readme中是可以指定的,不知道为什么我使用的1.5.0 中,命令帮助中没有端口的选项。而且指定了端口也不生效。。。。好不巧,本机有服务占用了9090.。。。。

虽然问题自己能解决,但是还是希望改进一下。
非常感谢。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants