I have a project with Angular frontend served by a Django Rest API. My project is in the following structure.
example.com
|- client (holds angular files)
|- server (holds Django Rest Framework files)
The angular app makes calls to drf through http:
example.com/api/<params>
I'm hosting on a Linode Ubunutu 17.04, using Apache and uWSGI. I can't seem to figure out the best way to serve both Angular and Django at the same time? I can easily host the Django Rest API with the WSGI config, but can't figure out how Apache knows to point to Angular for normal requests.
What's wrong with the below solution or is there a better way?
In /etc/apache2/sites-available/example.com.conf
<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/example.com/client/
</VirtualHost>
<VirtualHost *:80>
ServerName example.com/api
ServerAlias www.example.com/api
WSGIScriptAlias / var/www/example.com/index.wsgi
DocumentRoot /var/www/example.com/server/
</VirtualHost>
Any help would be greatly appreciated!