implement media serving
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
global using MaybeError;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
using MongoDB.Driver;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -12,7 +14,13 @@ public static class Extensions
|
||||
{
|
||||
public static IServiceCollection AddAoba(this IServiceCollection services)
|
||||
{
|
||||
var dbClient = new MongoClient("mongodb://NinoIna:27017");
|
||||
var db = dbClient.GetDatabase("Aoba");
|
||||
|
||||
services.AddSingleton(dbClient);
|
||||
services.AddSingleton<IMongoDatabase>(db);
|
||||
services.AddSingleton<AobaService>();
|
||||
services.AddSingleton<MediaService>();
|
||||
return services;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user