Skip to content

Commit 2f5420e

Browse files
authored
fix: Set default port to 8080 (#57)
* fix: Set default port to 8080 * adjust docker port * Update AppTests.swift * Update docker-compose.yml * Update Configuring Parse Server Swift.tutorial
1 parent 8cdfa86 commit 2f5420e

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ COPY --from=build --chown=vapor:vapor /staging /app
7373
# Ensure all further commands run as the vapor user
7474
USER vapor:vapor
7575

76-
# Let Docker bind to port 8081
77-
EXPOSE 8081
76+
# Let Docker bind to port 8080
77+
EXPOSE 8080
7878

7979
# Start the Vapor service when the image is run, default to listening on 8081 in production environment
8080
ENTRYPOINT ["./App"]
81-
CMD ["serve", "--env", "production", "--hostname", "0.0.0.0", "--port", "8081"]
81+
CMD ["serve", "--env", "production", "--hostname", "0.0.0.0", "--port", "8080"]

Sources/ParseServerSwift/Documentation.docc/Configuring Parse Server Swift.tutorial

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
@Section(title: "Hostname, Port, and TLS") {
1515
@Steps {
1616
@Step {
17-
By default, the hostname is `127.0.0.1` and the port is `8081`. These values can easily be changed:
17+
By default, the hostname is `127.0.0.1` and the port is `8080`. These values can easily be changed:
1818
```swift
1919
app.http.server.configuration.hostname = "your.hostname.com"
20-
app.http.server.configuration.port = 8081
20+
app.http.server.configuration.port = 8080
2121
app.http.server.configuration.tlsConfiguration = .none
2222
```
2323
}

Sources/ParseServerSwift/ParseServerConfiguration.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public struct ParseServerConfiguration {
5656
self.applicationId = applicationId
5757
self.primaryKey = primaryKey
5858
app.http.server.configuration.hostname = Environment.process.PARSE_SERVER_SWIFT_HOST_NAME ?? "localhost"
59-
app.http.server.configuration.port = Int(Environment.process.PARSE_SERVER_SWIFT_PORT ?? 8081)
59+
app.http.server.configuration.port = Int(Environment.process.PARSE_SERVER_SWIFT_PORT ?? 8080)
6060
app.http.server.configuration.tlsConfiguration = tlsConfiguration
6161
// swiftlint:disable:next line_length
6262
app.routes.defaultMaxBodySize = ByteCount(stringLiteral: Environment.process.PARSE_SERVER_SWIFT_DEFAULT_MAX_BODY_SIZE ?? "16kb")
@@ -90,7 +90,7 @@ public struct ParseServerConfiguration {
9090
*/
9191
public init(app: Application,
9292
hostName: String = "localhost",
93-
port: Int = 8081,
93+
port: Int = 8080,
9494
tlsConfiguration: TLSConfiguration? = nil,
9595
maxBodySize: ByteCount = "16kb",
9696
applicationId: String,

Tests/ParseServerSwiftTests/AppTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ final class AppTests: XCTestCase {
1313
let app = Application(.testing)
1414
let configuration = try ParseServerConfiguration(app: app,
1515
hostName: "hostName",
16-
port: 8081,
16+
port: 8080,
1717
applicationId: "applicationId",
1818
primaryKey: "primaryKey",
1919
webhookKey: hookKey,
@@ -46,7 +46,7 @@ final class AppTests: XCTestCase {
4646
defer { app.shutdown() }
4747
let configuration = try ParseServerConfiguration(app: app,
4848
hostName: "hostName",
49-
port: 8081,
49+
port: 8080,
5050
applicationId: "applicationId",
5151
primaryKey: "primaryKey",
5252
parseServerURLString: "primaryKey")
@@ -58,7 +58,7 @@ final class AppTests: XCTestCase {
5858
defer { app.shutdown() }
5959
let configuration = try ParseServerConfiguration(app: app,
6060
hostName: "hostName",
61-
port: 8081,
61+
port: 8080,
6262
applicationId: "applicationId",
6363
primaryKey: "primaryKey",
6464
parseServerURLString: "primaryKey")

docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,17 @@ services:
5757
environment:
5858
<<: *shared_environment
5959
PARSE_SERVER_SWIFT_HOST_NAME: cloud-code # Should be same name as docker service
60-
PARSE_SERVER_SWIFT_PORT: 8081
60+
PARSE_SERVER_SWIFT_PORT: 8080
6161
PARSE_SERVER_SWIFT_DEFAULT_MAX_BODY_SIZE: 16kb
6262
PARSE_SERVER_SWIFT_URLS: http://parse:1337/parse #,http://parse2:1337/parse # Only need to list one server.
6363
PARSE_SERVER_SWIFT_APPLICATION_ID: ${PARSE_SERVER_APPLICATION_ID}
6464
PARSE_SERVER_SWIFT_PRIMARY_KEY: ${PARSE_SERVER_PRIMARY_KEY}
6565
PARSE_SERVER_SWIFT_WEBHOOK_KEY: ${PARSE_SERVER_WEBHOOK_KEY}
6666
# ports:
67-
# - '8081:8081'
67+
# - '8081:8080'
6868
# user: '0' # uncomment to run as root for testing purposes even though Dockerfile defines 'vapor' user.
6969
restart: always
70-
command: ["serve", "--env", "production", "--hostname", "0.0.0.0", "--port", "8081"]
70+
command: ["serve", "--env", "production", "--hostname", "0.0.0.0", "--port", "8080"]
7171
# volumes:
7272
# - ./.env:/app/.env
7373
# - ./.env.production:/app/.env.production # Mount production environment if you have one.

0 commit comments

Comments
 (0)