fix: database upgrade and added basic timer
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using gaseous_server;
|
||||
using gaseous_tools;
|
||||
|
||||
// set up db
|
||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||
db.InitDB();
|
||||
|
||||
// set up server
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Add services to the container.
|
||||
@@ -13,6 +19,7 @@ builder.Services.AddControllers().AddJsonOptions(x =>
|
||||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddSwaggerGen();
|
||||
builder.Services.AddHostedService<TimedHostedService>();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
@@ -29,10 +36,6 @@ app.UseAuthorization();
|
||||
|
||||
app.MapControllers();
|
||||
|
||||
// set up db
|
||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||
db.InitDB();
|
||||
|
||||
// start the app
|
||||
app.Run();
|
||||
|
||||
|
Reference in New Issue
Block a user