diff --git a/src/Project/Project.router.ts b/src/Project/Project.router.ts index 77be977d..e14ec663 100644 --- a/src/Project/Project.router.ts +++ b/src/Project/Project.router.ts @@ -17,6 +17,10 @@ import { Ownable } from '../Ownable' import { Project } from './Project.model' import { ProjectAttributes, projectSchema } from './Project.types' import { SearchableProject } from './SearchableProject' +import { PREVIEW_HASH } from '../Scene/utils' + +const BUILDER_SERVER_URL = process.env.BUILDER_SERVER_URL +const PEER_URL = process.env.PEER_URL export const THUMBNAIL_FILE_NAME = 'thumbnail' const FILE_NAMES = [ @@ -30,7 +34,6 @@ const FILE_NAMES = [ const MIME_TYPES = ['image/png', 'image/jpeg'] const validator = getValidator() - export class ProjectRouter extends Router { mount() { const withProjectExists = withModelExists(Project, 'id', { @@ -138,6 +141,12 @@ export class ProjectRouter extends Router { server.handleRequest(this.uploadFiles) ) + this.router.get( + '/projects/:id/about', + withProjectExists, + this.getPreviewAbout + ) + this.router.put( '/projects/:id/crdt', withAuthentication, @@ -281,6 +290,33 @@ export class ProjectRouter extends Router { return true } + async getPreviewAbout(req: Request, res: Response) { + const projectId = server.extractFromReq(req, 'id') + return res.json({ + healthy: true, + acceptingUsers: true, + configurations: { + globalScenesUrn: [], + scenesUrn: [ + `urn:decentraland:entity:${PREVIEW_HASH}?=&baseUrl=${BUILDER_SERVER_URL}v1/projects/${projectId}/contents/` + ] + }, + content: { + healthy: true, + publicUrl: `${PEER_URL}/content` + }, + lambdas: { + healthy: true, + publicUrl: `${PEER_URL}/lambdas` + }, + comms: { + healthy: true, + protocol: "v3", + fixedAdapter: "offline:offline" + } + }) + } + async upsertCrdt(_req: AuthRequest) { return true } diff --git a/src/Scene/utils.ts b/src/Scene/utils.ts new file mode 100644 index 00000000..6b23cfc0 --- /dev/null +++ b/src/Scene/utils.ts @@ -0,0 +1 @@ +export const PREVIEW_HASH = 'bafkreiczoxhrxosdeoi4srth6wegejpwsn34bkult6rb7xp3ehejxt4qsi'