add readme and change some scripts

This commit is contained in:
Zutatensuppe 2021-05-22 13:19:39 +02:00
parent 239c879649
commit 6474c2fd8c
15 changed files with 265 additions and 231 deletions

View file

@ -1,5 +1,8 @@
import vite from 'vite'
import vue from '@vitejs/plugin-vue'
import fs from 'fs'
// TODO: replace with import, when esm json import is available
const cfg = JSON.parse(String(fs.readFileSync('./config.json')))
export default vite.defineConfig({
plugins: [ vue() ],
@ -10,12 +13,8 @@ export default vite.defineConfig({
},
server: {
proxy: {
'^/(api|uploads)/.*': {
target: 'http://localhost:1337',
secure: false,
},
'^/upload': {
target: 'http://localhost:1337',
'^/((api|uploads)/.*|upload)': {
target: `http://${cfg.http.hostname}:${cfg.http.port}`,
secure: false,
},
},