Browse Source

Generate dist on directory up to simplify test and production

master
Peter Stuifzand 2 years ago
parent
commit
2afde26606
  1. 1
      .gitignore
  2. 2
      Dockerfile
  3. 2
      editor/webpack.config.js
  4. 2
      main.go

1
.gitignore

@ -3,3 +3,4 @@ wiki
data/
session/
editor/node_modules/*
dist/

2
Dockerfile

@ -5,5 +5,5 @@ EXPOSE 80
WORKDIR /app
ADD ./wiki /app
ADD ./templates /app/templates
ADD ./editor/dist /app/public
ADD ./dist /app/dist
ENTRYPOINT ["/app/wiki"]

2
editor/webpack.config.js

@ -10,7 +10,7 @@ module.exports = {
},
output: {
filename: '[name].bundle.js',
path: path.resolve(__dirname, 'dist')
path: path.resolve(__dirname, '../dist')
},
module: {

2
main.go

@ -549,7 +549,7 @@ func main() {
response.Meta.Title = "Test"
json.NewEncoder(w).Encode(response)
})
http.Handle("/public/", http.StripPrefix("/public/", http.FileServer(http.Dir("/home/peter/work/editorjs/dist/"))))
http.Handle("/public/", http.StripPrefix("/public/", http.FileServer(http.Dir("./dist"))))
http.Handle("/save/", &saveHandler{})
http.Handle("/edit/", &editHandler{})
http.Handle("/history/", &historyHandler{})

Loading…
Cancel
Save