diff --git a/pinry-spa/src/components/Pins.vue b/pinry-spa/src/components/Pins.vue index 5a53576..b40d72a 100644 --- a/pinry-spa/src/components/Pins.vue +++ b/pinry-spa/src/components/Pins.vue @@ -1,21 +1,153 @@ diff --git a/pinry-spa/src/components/utils/PinHandler.js b/pinry-spa/src/components/utils/PinHandler.js new file mode 100644 index 0000000..0a4df2e --- /dev/null +++ b/pinry-spa/src/components/utils/PinHandler.js @@ -0,0 +1,13 @@ +/** + * Remove http prefix from url. + * @param url: String +*/ +function escapeUrl(url) { + const uri = new URL(url); + return uri.pathname; +} + + +export default { + escapeUrl, +}; diff --git a/pinry-spa/src/main.js b/pinry-spa/src/main.js index e1a0323..3df5785 100644 --- a/pinry-spa/src/main.js +++ b/pinry-spa/src/main.js @@ -1,6 +1,6 @@ import Buefy from 'buefy'; import Vue from 'vue'; -import VueMasonryPlugin from 'vue-masonry'; +import { VueMasonryPlugin } from 'vue-masonry'; import App from './App.vue'; diff --git a/pinry-spa/vue.config.js b/pinry-spa/vue.config.js index 3647f32..39cb39b 100644 --- a/pinry-spa/vue.config.js +++ b/pinry-spa/vue.config.js @@ -5,9 +5,10 @@ module.exports = { target: 'http://localhost:8000/', changeOrigin: true, ws: true, - pathRewrite: { - '^/api': '/api', - }, + }, + '/static/media': { + target: 'http://localhost:8000/', + changeOrigin: true, }, }, },