This web app shows the menu and more info about 'frituren' in the Ghent area.
You will have to add 3 files, 2 are called /src/environments/environment(.prod).ts
with the necessary api keys and should look like this:
export const environment = {
production: true,
backendurl: "https://<URL>:<SERVER_PORT>/<API_PATH>",
imgurapikey: "<PASTE_PRODUCTION_API_KEY>",
mapskey: '<PASTE_PRODUCION_API_KEY>'
};
You will need a Google Maps Javascript API key and a Imgur API key.
The third file should be called /server/.env
and looks like this:
MONGODB_URI=mongodb://localhost/frietdb
JWT_SECRET=-e,aj(ef,X$X>F6'^uDH8;u\uDDz)"9`
There are tests for the backend server. go to /server/
in your terminal and execute the command npm run testsetup
, for subsequent runs you should use npm run test
.
Run npm run all
for a full dev server. Navigate to http://localhost:4200/
. The frontend will automatically reload if you change any of the source files.
npm start
: runs only frontend Angular 4 appnpm run mongo
: runs backend MongoDB servernpm run express
: runs backend Express.js servernpm run server
: runs all backend servers
Run ng build
to build the project. The build artifacts will be stored in the dist/
directory. Use the -prod
flag for a production build.
When building for Github Pages you should build with add: --base-href "https://USERNAME.github.io/REPOSITORY_NAME/"
. Next, duplicate the index.html
file and name it 404.html
.
To publish it, remove /dist
from .gitignore
, make a local commit and push to the gh-pages branch with:
$ git push origin `git subtree split --prefix dist master`:gh-pages --force
Lastly undo the edit in .gitignore
and reset your master branch with git reset HEAD~
.
Don't forget to re-enable your custom domain if you are using one.
Navigate to the root of the project and add your heroku app to the repo by running:
$ heroku git:remote -a frietdb
Next you can install mongodb by running heroku addons:create mongolab
. Lastely push the server to your heroku dyno with:
$ git subtree push --prefix server heroku master
You will only need to repeat the previous command when you wish to update the dyno.
The script deploy.sh
should do all the above actions automatically. Just make sure you change the domainname in the script. You should have completed the process manually first before you use the script.
To get more help on the Angular CLI use ng help
or go check out the Angular CLI README.