Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            // Load configs
            LoadConfigsAsync();

            // Create builder
            var builder = WebApplication.CreateBuilder(args);

            builder.Host.ConfigureWebHostDefaults(webBuilder =>
            {
                webBuilder.UseUrls("http://localhost:3000", "https://localhost:3001");
            });

            // Set up services
            ConfigureServices(builder);

            // Build web app
            var app = builder.Build();

            // Configure application
            ConfigureApp(app);

            app.MapGet("/api/ping", () => "pong");

            // Add API routes
            BaseAPI.AddRoutes(app);
            UploadAPI.AddRoutes(app);
            ChannelAPI.AddRoutes(app);
            CategoryAPI.AddRoutes(app);
            PlanetAPI.AddRoutes(app);
            UserAPI.AddRoutes(app);
            MemberAPI.AddRoutes(app);
            RoleAPI.AddRoutes(app);
            EmbedAPI.AddRoutes(app);

            // Run
            app.Run();
        }