Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Google App Engine with Webjars?

I have a Google App Engine (1.8.5) project. I would like to serve up static Javascript & CSS via Webjars. However, I keep getting HTTP 404 errors. How do I make my Webjars files accessible?

My src/main/webapp/WEB-INF/appengine-web.xml per Google's documentation:

<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
    ...
    <static-files>
        <include path="/resources/**" />
        <include path="/webjars/**" />
    </static-files>
</appengine-web-app> 

My src/main/webapp/index.html, referencing the Webjars-provided Bootstrap CSS file:

<html>
<head>
    <link rel="stylesheet" href="webjars/bootstrap/3.0.0/css/bootstrap.min.css">
</head>
...
</html>

Snippets of pom.xml:

    <dependency>
        <groupId>com.google.appengine</groupId>
        <artifactId>(lots)</artifactId>
        <version>1.8.5</version>
    </dependency>
    <dependency>
        <groupId>com.google.inject</groupId>
        <artifactId>guice</artifactId>
        <version>4.0-beta</version>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <scope>provided</scope>
        <version>3.1.0</version>
    </dependency>
    <dependency>
        <groupId>org.webjars</groupId>
        <artifactId>bootstrap</artifactId>
        <version>3.0.0</version>
    </dependency>

This is my first GAE posted question, so I'm not sure what additional info to provide--be gentle, SO.

like image 657
JJ Zabkar Avatar asked Oct 02 '22 16:10

JJ Zabkar


People also ask

Can you run containers on App Engine?

Features. Customizable infrastructure - App Engine flexible environment instances are Compute Engine virtual machines, which means that you can take advantage of custom libraries, use SSH for debugging, and deploy your own Docker containers.


1 Answers

Unfortunately, Webjars requires a Servlet 3.x container, but the Google App Engine is currently still only on version 2.5.

You might want to star this issue in the GAE issues list.

like image 52
ᴇʟᴇvᴀтᴇ Avatar answered Oct 13 '22 11:10

ᴇʟᴇvᴀтᴇ