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

feat: Add ability to pass routes into configuration #74

Merged
merged 2 commits into from
Aug 4, 2024
Merged

Conversation

cbaker6
Copy link
Member

@cbaker6 cbaker6 commented Aug 4, 2024

Pass routes using:

@main
enum Entrypoint {
    static func main() async throws {
        var env = try Environment.detect()
        try LoggingSystem.bootstrap(from: &env)

        let app = try await Application.make(env)

        // This attempts to install NIO as the Swift Concurrency global executor.
        // You should not call any async functions before this point.
        let executorTakeoverSuccess = NIOSingletons.unsafeTryInstallSingletonPosixEventLoopGroupAsConcurrencyGlobalExecutor()
        app.logger.debug("Running with \(executorTakeoverSuccess ? "SwiftNIO" : "standard") Swift Concurrency default executor")

        // exampleRoutes is a function consisting of all of your own routes
        try await parseServerSwiftConfigure(
            app,
            using: exampleRoutes
        )
        try await app.execute()
        try await app.asyncShutdown()
    }
}

Copy link

codecov bot commented Aug 4, 2024

Codecov Report

Attention: Patch coverage is 82.05128% with 14 lines in your changes missing coverage. Please review.

Project coverage is 35.54%. Comparing base (336b0d2) to head (e7bf503).

Files Patch % Lines
Sources/ParseServerSwift/Parse.swift 17.64% 14 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #74      +/-   ##
==========================================
+ Coverage   33.29%   35.54%   +2.24%     
==========================================
  Files          11       11              
  Lines         925      965      +40     
==========================================
+ Hits          308      343      +35     
- Misses        617      622       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cbaker6 cbaker6 merged commit 7c11bd3 into main Aug 4, 2024
5 checks passed
@cbaker6 cbaker6 deleted the updates branch August 4, 2024 16:21
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

Successfully merging this pull request may close these issues.

1 participant