Merge pull request #1381 from davidbmx/master

resolve path present assets #1268
This commit is contained in:
Cassie Tarakajian 2020-04-10 18:30:52 -04:00 committed by GitHub
commit 649627bfdc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -25,7 +25,7 @@ export function serveProject(req, res) {
const sketchDoc = window.document; const sketchDoc = window.document;
const base = sketchDoc.createElement('base'); const base = sketchDoc.createElement('base');
const fullUrl = `https://${req.get('host')}${req.originalUrl}`; const fullUrl = `${req.protocol}://${req.get('host')}${req.originalUrl}`;
base.href = `${fullUrl}/`; base.href = `${fullUrl}/`;
sketchDoc.head.appendChild(base); sketchDoc.head.appendChild(base);

View file

@ -7,6 +7,8 @@ const router = new Router();
router.get('/:username/sketches/:project_id/*', getProjectAsset); router.get('/:username/sketches/:project_id/*', getProjectAsset);
router.get('/full/:project_id/*', getProjectAsset); router.get('/full/:project_id/*', getProjectAsset);
router.get('/:username/full/:project_id/*', getProjectAsset); router.get('/:username/full/:project_id/*', getProjectAsset);
router.get('/present/:project_id/*', getProjectAsset);
router.get('/:username/present/:project_id/*', getProjectAsset);
router.get('/embed/:project_id/*', getProjectAsset); router.get('/embed/:project_id/*', getProjectAsset);
router.get('/:username/embed/:project_id/*', getProjectAsset); router.get('/:username/embed/:project_id/*', getProjectAsset);