I'm currently working on a small AngularJS application to deploy on a web server, but I'm having a hard time understanding the difference between using Angular's startup seed compared to linking the script in the HTML, like this:
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.4/angular.js"></script>
I understand that using the startup seed lets you develop locally, but you can also link the script and download something like http-server to achieve the same effect, right?
So what are the benefits/drawbacks to using one startup method over another? Specifically, which would be more beneficial for hosting the app on a web server like Apache?
The benefit the seed adds is in configuration. They have done a lot of setup by creating and configuring a task runner to handle things like running a local web server, unit and e2e testing.
Without the seed you would have to set all of that up yourself from scratch. But if you don't care about testing, and you want to use your own local web server, then you don't need it.
Honestly if you are planning on hosting your even-remotely serious web app on a server, you have a lot more to worry about than what the seed provides.
You'll need a build process to concatenate all of your vendor and source code into a one large minified, obfuscated file for serving to the masses, for starters.
https://g00glen00b.be/angular-grunt/
Related
I'm trying to start my first web project. My experience is with .NET desktop development and I'm very new to the Java/Kotlin world. Client side I want to use React and write the code in Kotlin, then transpile to JavaScript. Server side I would like to use Ktor both to serve the static content (React app + various assets) and REST endpoints for the SPA. I would like to use the Multiplatform feature to be able to share as much code as possible. My IDE is IntelliJ IDEA.
I would like to have auto-reload and be able to debug both React and server code for development and I would like to be able to create a single fat jar with the complete application (frontend+backend).
I started with the template that IntelliJ provides for multiplatform JS+JVM. I have been working on it for more than one day with little success and also haven't been able to find any sample online with all the features, and also haven't been able to combine various samples due to insufficient knowledge. Only thing I got is either running the application without autoreload or creating the jar file by adding "manifest" to the build.gradle file which breaks my run configuration.
I would very much appreciate if someone could provide or point me to an example with these features which I can use as an starting point for my application.
Here is a link to an example to get you started.
https://play.kotlinlang.org/hands-on/Full%20Stack%20Web%20App%20with%20Kotlin%20Multiplatform/01_Introduction
I have an AngularJS site consuming an API written in Sinatra.
I'm simply trying to deploy these 2 components together on an AWS EC2 instance.
How would one go about doing that? What tools do you recommend? What structure do you think is most suitable?
Cheers
This is based upon my experience of utilizing the HashciCorp line of tools.
Manual: Launch an Ubuntu image, gem install sinatra and deploy your code. Take a snapshot for safe keeping. This one off approach is good for a development box to iron out the configuration process. Write down the commands you run and any options you may need.
Automated: Use the Packer EC2 Builder and Shell Provisioner to automate your commands from the previous manual approach. This will give you a configured AMI that can be launched.
You can apply different methods of getting to an AMI using different toolsets. However, in the end, you want a single immutable image that can be deployed. repeatedly.
It is possible to minimize all custom java script file Manually or Automatically ?
We are using TFS for source code management , Its also possible that auto minimize Java script file by source control system or build system , when deploy code in windows Azure system or web deploy?
Note - I am not using .net application its core AngularJs application and communication done by web-api hosted on other server.
It is possible, you could integrate a build script runner like Grunt with your TFS that could minify all your javascript files. When you use Grunt you can also run it manually when developing.
I would suggest you take some time to get familiar with build script runners like Grunt to see what the possibilities are.
TL;DR Is there a way to deploy App Engine modules in parallel?
I've built a go application using Google's App Engine SDK for Go. This application defines multiple modules. These modules are self-contained, and do not require any sort of dependency across other modules.
When I attempt to deploy the modules to the Google Cloud, I can't help but notice that the modules are uploaded sequentially. This would be fine if deployment was relatively quick, but each module requires it's own redundant compilation of the Go binary. Hence, on top of the regular upload time, I have to wait for my app to compile [module count] x [compilation time] every time I want to deploy.
The obvious (quick) solution is to deploy in parallel, so I created a simple bash script to deploy each module independently. The problem I immediately encountered with this "solution" was a HTTP 500 response from the App Engine API. The whole umbrella application, spanning across all the modules, seems to "lock" whenever any individual module is updated. This scenario creates a race condition, under which only the first module to trigger a deploy succeeds and the others fail.
I fear that this is a holdover from the legacy languages in App Engine. Since every module uses the same Go binary, it doesn't really necessitate multiple compilations of the same code. Repeated compilation is redundant, and there is no way to circumvent the lock.
One hypothetical solution, which I have only a vague understanding of, is to compile in parallel and deploy in series. I imagine that this approach would involve taking apart the configuration tool and reworking it to execute in the aforementioned manner- though I can't say for sure (yet).
Any help here would be much obliged. Thanks!
You can deploy to another "version" of your App Engine app, then when all modules are deployed, do a very fast version switch?
Versions also allow for traffic splitting if you need/want that kind of thing.
We currently run and deploy on app engine, but use GitHub as version control. What is the best way to run a series of tests every time we push to GitHub, both client-side Javascript tests, using something like PhantomJS as well as something like NoseTests for Python?
The reason being that client side code is in Javascript while the server side code is in Python.
And since we have existing credits, we'd prefer not to go for a 3rd part hosted solution. App Engine also provides a pipeline for just node tests, but this doesn't cover the Javascript unit tests.
Thanks!
I believe github commit webhooks are what you are looking for. I have not personally set them up, but at my day job, we have it automatically run a handful of things including builds + tests.
https://help.github.com/articles/about-webhooks/
There is a Google Scrip to accurately test the backend loads. Unfortunately I don't know of anything from JS.
In the documentation for App Engine and in presentations we've given at Google I/O we have mentioned that you should ramp up slowly when load testing an application on App Engine. Ramping up too quickly won't give an accurate picture of how App Engine scales; you have to accomodate our load balancing code which determines how many instances of your application to spin up by watching how much traffic is directed to your application. That monitoring and adjustment takes time, therefore the need for not ramping up too quickly.
I've looked at various load testing tools and in the end wrote my own short script in Python which I use as a base for all my load testing. This isn't to say that what I have here is better for load testing than the available packages, please look at them and judge them against your own criteria. I'm most comfortable with Python and a skeleton script that can be tweaked for each test scenario is optimal for me.