LoginSignup
0
0

More than 5 years have passed since last update.

Vapor のホストネームと起動ポートを変更する

Posted at

Vapor のホストネームと起動ポートを変更する方法です。
以下の方法でlocalhost:8080から任意のホストネーム、ポートに変更することが可能です。

コマンドでホストネームとポートを変更する場合

$ swift run Run --hostname 0.0.0.0 --port 9090

設定ファイルに記述する場合

configure.swift
let serverConfiure = NIOServerConfig.default(hostname: "0.0.0.0", port: 9090)
services.register(serverConfiure)

参考: Changing hostname and port with Vapor 3

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0