mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) move home server into core
Summary: This moves enough server material into core to run a home server. The data engine is not yet incorporated (though in manual testing it works when ported). Test Plan: existing tests pass Reviewers: dsagal Reviewed By: dsagal Differential Revision: https://phab.getgrist.com/D2552
This commit is contained in:
26
app/server/lib/GristServer.ts
Normal file
26
app/server/lib/GristServer.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import {SessionUserObj} from 'app/server/lib/BrowserSession';
|
||||
import * as Comm from 'app/server/lib/Comm';
|
||||
import {Hosts} from 'app/server/lib/extractOrg';
|
||||
import {ICreate} from 'app/server/lib/ICreate';
|
||||
import {Sessions} from 'app/server/lib/Sessions';
|
||||
import * as express from 'express';
|
||||
|
||||
/**
|
||||
* Basic information about a Grist server. Accessible in many
|
||||
* contexts, including request handlers and ActiveDoc methods.
|
||||
*/
|
||||
export interface GristServer {
|
||||
readonly create: ICreate;
|
||||
getHost(): string;
|
||||
getHomeUrl(req: express.Request, relPath?: string): string;
|
||||
getHomeUrlByDocId(docId: string, relPath?: string): Promise<string>;
|
||||
}
|
||||
|
||||
export interface GristLoginMiddleware {
|
||||
getLoginRedirectUrl(target: URL): Promise<string>;
|
||||
getSignUpRedirectUrl(target: URL): Promise<string>;
|
||||
getLogoutRedirectUrl(nextUrl: URL, userSession: SessionUserObj): Promise<string>;
|
||||
|
||||
// Returns arbitrary string for log.
|
||||
addEndpoints(app: express.Express, comm: Comm, sessions: Sessions, hosts: Hosts): string;
|
||||
}
|
||||
Reference in New Issue
Block a user