1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-08-04 13:48:56 +02:00
unleash.unleash/src/server-dev.ts
Nuno Góis bd5a8539c0
chore: add project list view toggle with respective flag (#10452)
https://linear.app/unleash/issue/2-3746/add-project-list-view-toggle-with-respective-flag

Adds a project list view toggle hidden behind a feature flag:
`projectListViewToggle`.

This is already part of the persistent project list page state.

Even though the view mode switching logic is in place, this isn't really
doing anything else. We'll leave the actual visual changes (tables) for
a follow up PR.

<img width="1412" height="406" alt="image"
src="https://github.com/user-attachments/assets/793d0bd9-9874-4630-98b4-0ee364f50241"
/>
2025-08-04 08:53:04 +01:00

98 lines
3.9 KiB
TypeScript

import { start } from './lib/server-impl.js';
import { createConfig } from './lib/create-config.js';
import { LogLevel } from './lib/logger.js';
import { ApiTokenType } from './lib/types/model.js';
process.nextTick(async () => {
try {
await start(
createConfig({
db: process.env.DATABASE_URL
? undefined
: {
user: 'unleash_user',
password: 'password',
host: 'localhost',
port: 5432,
database:
process.env.UNLEASH_DATABASE_NAME || 'unleash',
schema: process.env.UNLEASH_DATABASE_SCHEMA,
ssl: false,
applicationName: 'unleash',
},
server: {
enableRequestLogger: true,
baseUriPath: '',
// keepAliveTimeout: 1,
gracefulShutdownEnable: true,
// cdnPrefix: 'https://cdn.getunleash.io/unleash/v4.4.1',
enableHeapSnapshotEnpoint: true,
},
logLevel: LogLevel.debug,
secureHeaders: false,
versionCheck: {
enable: false,
},
experimental: {
// externalResolver: unleash,
flags: {
anonymiseEventLog: false,
responseTimeWithAppNameKillSwitch: false,
outdatedSdksBanner: true,
disableShowContextFieldSelectionValues: false,
feedbackPosting: true,
manyStrategiesPagination: true,
enableLegacyVariants: false,
extendedMetrics: true,
originMiddlewareRequestLogging: true,
webhookDomainLogging: true,
releasePlans: false,
showUserDeviceCount: true,
deltaApi: true,
uniqueSdkTracking: true,
strictSchemaValidation: true,
reportUnknownFlags: true,
customMetrics: true,
lifecycleMetrics: true,
improvedJsonDiff: true,
impactMetrics: true,
crDiffView: true,
paygTrialEvents: true,
timestampsInChangeRequestTimeline: true,
lifecycleGraphs: true,
addConfiguration: true,
projectListViewToggle: true,
},
},
authentication: {
initApiTokens: [
{
environment: '*',
projects: ['*'],
secret: '*:*.964a287e1b728cb5f4f3e0120df92cb5',
type: ApiTokenType.ADMIN,
tokenName: 'some-user',
},
],
},
prometheusImpactMetricsApi: 'http://localhost:9090',
/* can be tweaked to control configuration caching for /api/client/features
clientFeatureCaching: {
enabled: true,
maxAge: 4000,
},
*/
}),
);
} catch (error) {
if (error.code === 'EADDRINUSE') {
// eslint-disable-next-line no-console
console.warn('Port in use. You might want to reload once more.');
} else {
// eslint-disable-next-line no-console
console.error(error);
process.exit();
}
}
}, 0);