- 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
docker
but ratherdocker-compose
alongside it that givesa quick way
to 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/explorer
and play around.
- Open your browser to
- How can I access mongo once its running?
- Use
mongo shell
orRoboMongo
orMongoChef
or any client you best see fit .. to connect tomongodb://localhost:3001/loopback-mongo-sandbox
from your host machine.
- Use
- Why is loopback published on its default port
3000
but mongo is published to a non-default port3001
?- Background: Loopback refers to mongo via the url
mongodb://mongo:27017/loopback-mongo-sandbox
which leverages the mapping created bydocker-compose
for themongo
service. - Answer: If mongo was published on its default port then
mongodb://localhost:27017/loopback-mongo-sandbox
would also start working as a valid URL withindatasources.json
and 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