I've built a database with Node.js
and MongoDB
, and I'm writing an Angular.js
app that should call in entries from my database, as well as being able to write in those entries.
I'm aware that there are some security issues with writing directly from javascript to a database, but I'm completely new to this sort of thing. What's more, I can't find any instructions on how to send data from MongoDB
to my front-end so that I can actually use it!
How do I tie the two together? In Node.js
, I was using a javascript require
function to load in my database and read/write from it, but I can't figure out a way to do this in the browser. In node
I was using the mongojs
module to connect the two together, but this doesn't work in my Angular app as I can't use require
.
The main question is: How do I load in MongoDB to the front-end?
EDIT: I think this is a more basic question about calling MongoDB to the front-end, rather than angular-specific. If I'm wrong, let me know.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…