diff --git a/lib/index.js b/lib/index.js index 9ce1274..b1f313a 100644 --- a/lib/index.js +++ b/lib/index.js @@ -198,7 +198,7 @@ class App } // Open in browser - const url = this.config.domain + '/' + project.slug + const url = this.config.domain console.log('app'.green.bold + ' - ' + url.yellow) if(this.config.open) diff --git a/lib/projects.js b/lib/projects.js index e7a0dce..a08b9c6 100644 --- a/lib/projects.js +++ b/lib/projects.js @@ -99,6 +99,7 @@ class Projects describe() { const result = {} + result.domain = this.config.domain result.all = {} for(const _slug in this.all) diff --git a/lib/site.js b/lib/site.js index 31cf65f..0b077da 100644 --- a/lib/site.js +++ b/lib/site.js @@ -103,100 +103,6 @@ class Site { this.express.use('/', express.static(path.join(__dirname, '../site/dist'))) - // // Project route - // this.express.get('/' + _project.slug, (request, response) => - // { - // response.send(` - // download project - // download file - - //
- - // - - // - - // - // - // `) - // }) - // Project download route this.express.get('/' + _project.slug + '/download', (request, response) => { diff --git a/site/src/components/connexion/script.js b/site/src/components/connexion/script.js index f68fd28..8454460 100644 --- a/site/src/components/connexion/script.js +++ b/site/src/components/connexion/script.js @@ -47,6 +47,7 @@ export default this.projectsSocket.on('update_projects', (data) => { + this.$store.commit('updateUrl', data.domain) this.$store.commit('updateProjects', data.all) }) }, diff --git a/site/src/components/file/script.js b/site/src/components/file/script.js index b5ab8c7..96b419b 100644 --- a/site/src/components/file/script.js +++ b/site/src/components/file/script.js @@ -13,9 +13,9 @@ export default computed: { - project() + downloadUrl() { - return this.$store.state.projects.current + return `${this.$store.state.url}/${this.$store.state.projects.current.slug}/files/${this.content.path.full}` } }, diff --git a/site/src/components/file/template.html b/site/src/components/file/template.html index c5ac4a1..ae320ec 100644 --- a/site/src/components/file/template.html +++ b/site/src/components/file/template.html @@ -2,7 +2,7 @@