- With this starter project, you can jump straight to writing your business logic.
- Mongo is setup and configured to work with loopback already.
- With docker, deploying is as simple as running
docker-compose up - Reset password mixin is already baked-in.
- You only provide minimal configuration to get it going.
- Why was this project created?
- To provide a quick way to experiment with loopback and mongo together.
- Why use docker?
- Its not just
dockerbut ratherdocker-composealongside it that givesa quick wayto bring servers up and get going.
- Its not just
- Are there other such projects?
- Sure, searching on GitHub with loopback mongo filename:docker-compose.yml, yields close to 6 results when this line in the README was last edited.
- How can I access loopback once its running?
- Open your browser to
http://localhost:3000/explorerand play around.
- Open your browser to
- How can I access mongo once its running?
- Use
mongo shellorRoboMongoorMongoChefor any client you best see fit .. to connect tomongodb://localhost:3001/loopback-mongo-sandboxfrom your host machine.
- Use
- Why is loopback published on its default port
3000but mongo is published to a non-default port3001?- Background: Loopback refers to mongo via the url
mongodb://mongo:27017/loopback-mongo-sandboxwhich leverages the mapping created bydocker-composefor themongoservice. - Answer: If mongo was published on its default port then
mongodb://localhost:27017/loopback-mongo-sandboxwould also start working as a valid URL withindatasources.jsonand users wouldn't notice a difference. I wanted to discourage that and bring attention to the benefits of referencing a service by name. You won't live on localhost forever, as your code will reach the world one day!
- Background: Loopback refers to mongo via the url
Choose one:
-
Deploy Locally
cd ~/dev git clone https://github.com/ShoppinPal/loopback-mongo-sandbox.git cd ~/dev/loopback-mongo-sandbox docker-compose run builder npm install docker-compose up