mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-16 17:46:18 +08:00
Revert "fix(server): redirect to setup page if not initialized (#7871)"
This reverts commit 42b5ef7a8b.
This commit is contained in:
@@ -1,13 +1,10 @@
|
||||
import { join, resolve } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { join } from 'node:path';
|
||||
|
||||
import {
|
||||
DynamicModule,
|
||||
ForwardReference,
|
||||
Logger,
|
||||
MiddlewareConsumer,
|
||||
Module,
|
||||
NestModule,
|
||||
} from '@nestjs/common';
|
||||
import { ScheduleModule } from '@nestjs/schedule';
|
||||
import { ServeStaticModule } from '@nestjs/serve-static';
|
||||
@@ -19,7 +16,7 @@ import { ADD_ENABLED_FEATURES, ServerConfigModule } from './core/config';
|
||||
import { DocModule } from './core/doc';
|
||||
import { FeatureModule } from './core/features';
|
||||
import { QuotaModule } from './core/quota';
|
||||
import { CustomSetupModule, SetupMiddleware } from './core/setup';
|
||||
import { CustomSetupModule } from './core/setup';
|
||||
import { StorageModule } from './core/storage';
|
||||
import { SyncModule } from './core/sync';
|
||||
import { UserModule } from './core/user';
|
||||
@@ -138,26 +135,16 @@ export class AppModuleBuilder {
|
||||
}
|
||||
|
||||
compile() {
|
||||
const configure = (consumer: MiddlewareConsumer) => {
|
||||
if (this.config.isSelfhosted) {
|
||||
consumer.apply(SetupMiddleware).forRoutes('*');
|
||||
}
|
||||
};
|
||||
|
||||
@Module({
|
||||
imports: this.modules,
|
||||
controllers: this.config.isSelfhosted ? [] : [AppController],
|
||||
})
|
||||
class AppModule implements NestModule {
|
||||
configure = configure;
|
||||
}
|
||||
class AppModule {}
|
||||
|
||||
return AppModule;
|
||||
}
|
||||
}
|
||||
|
||||
const pwd = resolve(fileURLToPath(import.meta.url), '../../');
|
||||
|
||||
function buildAppModule() {
|
||||
AFFiNE = mergeConfigOverride(AFFiNE);
|
||||
const factor = new AppModuleBuilder(AFFiNE);
|
||||
@@ -192,12 +179,12 @@ function buildAppModule() {
|
||||
config => config.isSelfhosted,
|
||||
CustomSetupModule,
|
||||
ServeStaticModule.forRoot({
|
||||
rootPath: join(pwd, 'static', 'admin'),
|
||||
renderPath: /^\/admin\/?/,
|
||||
rootPath: join('/app', 'static'),
|
||||
exclude: ['/admin*'],
|
||||
}),
|
||||
ServeStaticModule.forRoot({
|
||||
rootPath: join(pwd, 'static'),
|
||||
renderPath: '*',
|
||||
rootPath: join('/app', 'static', 'admin'),
|
||||
serveRoot: '/admin',
|
||||
})
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user