![]() In ‘package.json’, notice there is a command named ‘build’, which is used to compile the Angular app and save the output to ‘dist’ folder. You should find the link, it is the root url of the RESTful API.Īccess in browser, we see it returns data. Go to Heroku, you should see the new app ‘online-judge-api’ in the dashboard.Ĭlick on it, and switch to ‘Setting’ tab. If the build is finished successfully, the RESTful API service is deployed to Heroku. Once Travis notice the new submission, it starts to build the app according to the instructions configured in ‘.travis.yml’ file. Make any change to this MEAN app and submit it to Github. In the ‘Environment Variables’ section, paste your Heroku API Key in the field ‘Value’ and name it ‘HEROKU_API_KEY’, click ‘Add’ button. Keep the default settings for ‘General’ and ‘Auto Cancellation’. Login to, then go to ‘Profile’, click ‘Manage repositories on GitHub’ and add ‘online-judge-mean’.Ĭlick the ‘Settings’ of the new repository. We will use it to setup continuous integration on Travis. In addition, go to ‘Account settings’, copy the ‘API Key’. Add new Key: MONGOLAB_URI and Value: Your MongoDB link. Then, go to Settings, click ‘Reveal Config Vars’ button. Set app name ‘online-judge-api’, click ‘Create app’ button. ![]() Login to Heroku, go to Dashboard -> New -> Create new app. Language : node_js node_js : - " 8" sudo : false branches : only : - master cache : directories : - node_modules deploy : provider : heroku skip_cleanup : true keep-history : true api-key : secure : $HEROKU_API_KEY app : online-judge-api 2.3 Heroku It will be used for deploying the RESTful API(server). Notice the app name is ‘online-judge-api’. In the root folder of the project, create a file named ‘.travis.yml’. "test": "echo \"Error: no test specified\"", Do not specify ‘exit 1’ in the end of this command. It is empty as we don’t need any testing for this app. In ‘package.json’, notice there is a command named ‘start’, which is used to launch the express server.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |