Docker container for Lynda Polyglot class
288
Code for my Becoming a Polyglot talk
Many people understand the very basics of several languages, all the way to Hello World. However, this is too simple to learn from, and it’s challenging to make the translations in your head between all the different dialects (interpreted languages aren’t really different from each other like different languages – they work very much the same and the only difference is in the structure of the language). Out in our community are many people who firmly believe that moving from Ruby to Perl is not possible, that it’s very difficult to learn a new language, that it makes no sense to try to understand what “foreign” code might be doing.
In this repository are examples in several languages of a basic API in a common framework for that language. They all use the same mongodb backend, and all use the same single page HTML application.
All of them run at http://{server}:8080
The following paths work in each environment:
You will need to have mongodb installed and running. Installation info for the major platforms is at https://docs.mongodb.org/manual/installation/
To insert the information from the quoteid.json file to get your DB started, use the following command:
mongoimport --collection quotes --file data/quoteid.json --type json --jsonArray
cd python; pip install --user -r requirements.txt; python flask-server.py
cd node; npm install; node express-server.js
cd node; npm install; node hapi-server.js
cd ruby; gem install bundler; bundle install; ruby sinatra-server.rb
sudo cpan -i -f Dancer Dancer::Plugin::CRUD JSON MongoDB; perl dancer-server.pl
You can skip all of the setup instructions above and use the docker container if you like. First, install docker from http://www.docker.com
Next:
docker run -i -t -p 8080:8080 synedra/polyglot/etc/init.d/mongodb startmongoimport --collection quotes --file data/quoteid.json --type json --jsonArrayContent type
Image
Digest
Size
444.2 MB
Last updated
about 9 years ago
docker pull synedra/polyglot_class