This Angular CLI generated project can be be loaded into DigitalOcean App Platform, deployed and served
Since Angular is a SPA, serving the static files after build is all that's needed.
To do so, a server (serve) is pointed to the directory of the built files dist/sample-angular
and hooks the directory to a port to serve.
Log into your DigitalOcean account and open "Apps", or you can use this link: https://cloud.digitalocean.com/apps
Create or "Launch App", then select "Github"
Connect to your "Github" or other repo service shown. Then select your repository and branch of choice to use in creating the App.
For build command, enter npm run build
For run command, enter npm run startApp
Then "Launch App", and your app will then be created and deployed. After successful deployment, you should get a URL to open and view your angular app.
Sample URL is:
Run ng serve
for a dev server. Navigate to http://localhost:4200/
. The app will automatically reload if you change any of the source files.
Run ng generate component component-name
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module
.
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.
Run ng test
to execute the unit tests via Karma.
Run ng e2e
to execute the end-to-end tests via Protractor.
To get more help on the Angular CLI use ng help
or go check out the Angular CLI README.