Answer the question
In order to leave comments, you need to log in
How to write back-end in conjunction with Vue + mongodb?
Good afternoon, please do not throw stones for a possibly stupid question. At this stage, I am studying the Vue JS framework, I want to write a back-end in conjunction with it, or rather, study the back-end and write a small website in conjunction with Vue + mongodb + back-end. On the Internet, somehow from everything that was found, this is a bundle with express + axios + vue + mongodb. In what steppe to look, can someone already write just back-end in vue + mongodb bundles?
Answer the question
In order to leave comments, you need to log in
And what is special about this bundle?) Well, take Node + express so you don't have to choose for a long time. I think the simplest solution
If it is assumed that the backing will be complex, in which there will be a lot of things, or it is expected that in the future the backing will be actively added, changed, then I recommend writing in Ruby. In this case, you can write code quickly, using ready-made time-tested libraries (gems), while the code will be concise, clear and easily maintained in the future. If rest api, then you can choose the Ruby on rails 5 api mode framework. The bundle with RoR+vue+mongodb stacks perfectly.
If the backing is not difficult, then anything is possible.
If realtime, then nodejs or go.
There is an option not to write back at all, because MongoDB:
a) can host static content
b) can send the result of the request in the form of JSON directly to the front
c) can work with SSL certificates
d) can store and return binary data
e) can change incoming requests using the built-in Javascript engine (almost like Noda)
e) can change data prepared on request before sending it to the client using the same Javascript
Terribly useful so as not to produce server entities when wrapping a web app in Electron.
There is a minus: the Mongo server must look at the world with wide open ports 80 and / or 443.
It is in the world, and not just in the local infrastructure. Those. to make a website on these internets of yours, then the Manga ports will have to be opened.
There is also an overlapping plus: Manga rummages through the file system exclusively within its databases and does not pick up everything from the floor, as classic web servers do (Nginix, Apache, and other comrades).
A classic example: create a Nuxtjs application, do `nuxt generate` to generate site statics, push the content into the Mongo database, and ... that's it! Everything works, no need for Apaches, Njiniks, Nodes with Express. NOTHING MORE
Manga successfully copes with the storage of binary files, ie. pictures, sounds, videos - everything can be accessed directly from the browser at the right URL.
Well, and an additional bonus: using pure Javascript, you can change the contents of both the incoming request and the prepared data on the fly immediately before sending it to the client, even write your own CMS. Some do. Very common for: 1) Intranets, 2) IoT applications, 3) Electron applications.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question