0

I am looking at Hosting angular JS / HTML 5 web app on google app engine as a single page app. All my services are also on google app engine within the same project.

I have generated the basic directory structure for angularJS using yeoman generator.

Just created a directory under the /war/ folder of app engine project and placed the angular code in that.

EVERYTHING IS WORKING FINE !!!

Then Question ?

  1. Is this the right way to place a HTML page directly in the WAR folder of an App engine ? Or should I be placing HTML files under the SRC folder of an app engine project and pull them into war during deploy time ?

  2. Lets say million users try to access this single page web app, will such a hosting model help in scaling up ? Will app engine create more instances to serve this page.html ?

Note: I am 'NOT' using anything GWT for UI. Its just a single page app under a war folder !

Appreciate your inputs.

Srik

1
  • You can just host in the normal way Commented Jan 2, 2016 at 19:05

1 Answer 1

2
  1. I believe this is entirely up to your preferences. I put my angular apps in /src/main/node and copy the output of grunt during maven package phase like so:

    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-war-plugin</artifactId>
      <version>2.4</version>
      <configuration>
        <archiveClasses>true</archiveClasses>
        <webResources>
          <!-- in order to interpolate version from pom into appengine-web.xml -->
          <resource>
            <directory>${basedir}/src/main/webapp/WEB-INF</directory>
            <filtering>true</filtering>
            <targetPath>WEB-INF</targetPath>
          </resource>
          <resource>
            <directory>${basedir}/src/main/node/dist</directory>
            <filtering>false</filtering>
            <targetPath>/</targetPath>
          </resource>
        </webResources>
      </configuration>
    </plugin>
    

    While this seems the cleanest solution for me, you may not feel the same way. It really doesn't matter how your static content gets into your war as long as it does.

  2. There will be no instances for this. Static content (like html, js, css files) are served through Google's static content proxy, which is a content delivery network. So yes it will scale but you don't need instances for static content.

Sign up to request clarification or add additional context in comments.

1 Comment

Perfect !! Many thanks for your precise inputs. I too would prefer to have source inside SRC and have it copied over with a deployment script instead of directly placing them in WAR.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.