Clebeuf/beLocal — pull request #128 by sheoranjs24 (2014-12-23 07:33:20+00:00)
Title: Append api urls with /api/

Solves issue #101

- All REST API (backend) URLs are not prefixed with '/api/'.
- Changed front-end code to reflect the new URLs.
- Nginx listens to local port 9000 for user testing. (I changed the port from 8000 to 9000 to avoid port bind if someone wants to use `python manage.py runserver`.
- Added bin/nginx.conf. We can now locally check if nginx config is working. To test locally:
- Install nginx
- Create symbolic link for nginx.conf to nginx directory:
`ln -s beLocal/bin/nginx.conf /etc/nginx/sites-enable/beLocal.conf` [ For mac nginx directory is: /usr/local/etc/nginx/sites-enable/beLocal.conf']
- Run nginx server: `sudo nginx start` [ For mac: `sudo nginx` ]
- Run gunicorn: `sudo gunicorn server.wsgi:application --bind=localhost:8001`

For deployment:
- Ignore ngnix.conf file (i.e. don't symlink it to nginx directory). We already have a working config file.
- Change file src/client/api/scripts/services/stateservice.js, line 318 `return 'https://localhost/api/';`

If everything is working fine:
- Remove 'belocalvictoria.me' from settings.ALLOWED_HOSTS (src/server/server/settings.py)
- remove '@django' from nginx config file `location \ { try_files $uri $uri/index.html @django; }`