Answer the question
In order to leave comments, you need to log in
How to properly set up a development environment?
Hello, I have a question.
Developed a small spa application on vuejs
Used vue-cli webpack-simple
Now I want to connect backend to golang and I don't know how best to set up my environment for convenient development.
I plan to use vuex, websockets and for golang I use echo.
I thought this project structure
--controllers
--models
--template(This is where the vuejs application is stored)
....
And I don't know how to work with both golang and vuejs(Edit the code to include libraries)
I thought I could use gulp
If not difficult, tell me
Answer the question
In order to leave comments, you need to log in
try to use docker, docker-compose
- one container will be responsible purely for the frontend (vue-js application), if only statics are supposed, then use nginx as a base image, mount the section where the statics collected by webpack will be. If you need some more extensive logic such as tricky routing or server rendering, then use node as a base image, and express
- the second container will be responsible for implementing api on go
- the third nginx as a reverse proxy (it will scatter requests to the necessary ports)
in this way 3 containers will be launched: for the front node on port 8081, api on go on port 8082, nginx on port 80 and will proxy requests that start with /api on port 8082, the rest on 8081
in your application you access api something like this axios.get('/api/test').then(...)
Their environments seem to be unrelated.
Two separate projects/codebases.
Gulp and all that has nothing to do with it at all.
Separately put the golang and write the server code and run it.
The IDE is gogland from jetbrains.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question