mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: implement memo route
This commit is contained in:
@ -33,9 +33,6 @@ type Server struct {
|
||||
Profile *profile.Profile
|
||||
Store *store.Store
|
||||
|
||||
// API services.
|
||||
apiV2Service *apiv2.APIV2Service
|
||||
|
||||
// Asynchronous runners.
|
||||
backupRunner *backup.BackupRunner
|
||||
telegramBot *telegram.Bot
|
||||
@ -84,7 +81,8 @@ func NewServer(ctx context.Context, profile *profile.Profile, store *store.Store
|
||||
s.ID = serverID
|
||||
|
||||
// Serve frontend.
|
||||
frontend.Serve(e)
|
||||
frontendService := frontend.NewFrontendService(profile, store)
|
||||
frontendService.Serve(e)
|
||||
|
||||
// Serve swagger in dev/demo mode.
|
||||
if profile.Mode == "dev" || profile.Mode == "demo" {
|
||||
@ -110,9 +108,9 @@ func NewServer(ctx context.Context, profile *profile.Profile, store *store.Store
|
||||
apiV1Service := apiv1.NewAPIV1Service(s.Secret, profile, store, s.telegramBot)
|
||||
apiV1Service.Register(rootGroup)
|
||||
|
||||
s.apiV2Service = apiv2.NewAPIV2Service(s.Secret, profile, store, s.Profile.Port+1)
|
||||
apiV2Service := apiv2.NewAPIV2Service(s.Secret, profile, store, s.Profile.Port+1)
|
||||
// Register gRPC gateway as api v2.
|
||||
if err := s.apiV2Service.RegisterGateway(ctx, e); err != nil {
|
||||
if err := apiV2Service.RegisterGateway(ctx, e); err != nil {
|
||||
return nil, errors.Wrap(err, "failed to register gRPC gateway")
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user