feat: self-hosted provider

This commit is contained in:
DarkSky
2023-01-06 17:28:35 +08:00
parent f01c6e12d2
commit 9b278d29d5
3 changed files with 17 additions and 2 deletions

View File

@@ -3,5 +3,12 @@
"editor.defaultFormatter": "esbenp.prettier-vscode", "editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true, "editor.formatOnSave": true,
"editor.formatOnSaveMode": "file", "editor.formatOnSaveMode": "file",
"cSpell.words": ["blocksuite", "datacenter", "livedemo", "pnpm", "testid"] "cSpell.words": [
"blocksuite",
"datacenter",
"livedemo",
"pnpm",
"selfhosted",
"testid"
]
} }

View File

@@ -46,6 +46,10 @@ const nextConfig = {
source: '/api/:path*', source: '/api/:path*',
destination: destinationAC, destination: destinationAC,
}, },
{
source: '/collaboration/:path*',
destination: 'http://localhost:3000/collaboration/:path*',
},
]; ];
} else { } else {
let destinationStandard = 'http://100.77.180.48:11001/api/:path*'; let destinationStandard = 'http://100.77.180.48:11001/api/:path*';
@@ -58,6 +62,10 @@ const nextConfig = {
source: '/api/:path*', source: '/api/:path*',
destination: destinationStandard, destination: destinationStandard,
}, },
{
source: '/collaboration/:path*',
destination: 'http://localhost:3000/collaboration/:path*',
},
]; ];
} }
}, },

View File

@@ -18,7 +18,7 @@ const DynamicBlocksuite = ({
const openWorkspace: LoadWorkspaceHandler = async (workspaceId: string) => { const openWorkspace: LoadWorkspaceHandler = async (workspaceId: string) => {
if (workspaceId) { if (workspaceId) {
const dc = await getDataCenter(); const dc = await getDataCenter();
return dc.load(workspaceId, { providerId: 'affine' }); return dc.load(workspaceId, { providerId: 'selfhosted' });
} else { } else {
return null; return null;
} }