Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9236551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:19:12+00:00 2026-06-18T07:19:12+00:00

I wrote a game with HTML5. Locally, it only works if I run: python

  • 0

I wrote a game with HTML5. Locally, it only works if I run:

python -m SimpleHTTPServer

And then I open localhost:8000. So, just a bunch of .html and .js files won’t work. I want to put my game online and because of this Github (Pages) is out of question, because it won’t work.

This is the part of the code I need a server for (I do realize that localhost:8000/res/ won’t work on App Engine, I’ll need to change the address):

var mapFile = new XMLHttpRequest();
var self = this;
mapFile.open("GET", "http://localhost:8000/res/map" + mapNumber.toString() + ".txt", true);

mapFile.onreadystatechange = function() {
  if (mapFile.readyState === 4) {
    if (mapFile.status === 200) {
      self.lines = mapFile.responseText.split("\n");
      self.loadTilesFromLines();
    }
  }
};

mapFile.send(null);

So, I heard that Google App Engine would work, it supports Python and is very popular. Now, I don’t need anything like what they have in their documentation (which is pretty well-written):

import webapp2

class MainPage(webapp2.RequestHandler):
    def get(self):
        self.response.headers['Content-Type'] = 'text/plain'
        self.response.write('Hello, webapp2 World!')

app = webapp2.WSGIApplication([('/', MainPage)],
                              debug=True)

All I need is a SimpleHTTPServer that allows me to open my index.html on my-app.appspot.com.

I did try the example and got it up and running, but I can’t force my browser to open index.html or src/ or even res/.

So, I am not even sure if Google App Engine supports what I’m trying to achieve here. The documentation just focus on building applications that use Python and all I needed with Python was a SimpleHTTPServer, which I don’t think I need with App Engine.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T07:19:13+00:00Added an answer on June 18, 2026 at 7:19 am

    Yes it is very doable on what you’re trying to achieve here. Since you just want to serve static files it is very simple and you don’t need to include any Python code.

    Let’s assume that you have this following structure:

    └── my-game
        ├── app.yaml
        └── static
            ├── index.html
            ├── js
            │   └── script.js
            └── res
                └── map.txt
    

    This app.yaml should look like this:

    application: my-app
    version: 1
    runtime: python27
    api_version: 1
    threadsafe: yes
    
    handlers:
    
    - url: /
      static_files: static/index.html
      upload: static/index.html
    
    - url: /
      static_dir: static/
    

    After you’re going to install the Google App Engine SDK (if you didn’t do that already), you will be able to run the dev_appserver.py command from your terminal. If you have the above structure try to run it using the following:

    $ dev_appserver.py /path/to/my-game
    

    If everything went smoothly you’ll be able to see your index.html on http://localhost:8080, the map.txt on http://localhost:8080/res/map.txt and you should be able to figure out the rest.

    Note that you could still run your application using the python -m SimpleHTTPServer from within the static directory and test it on localhost:8000.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wrote a game years ago (under Windows 95) in Pascal. Since then over
I wrote a nice little game which works well in its .fla form. Because
I wrote this as a simple dice game. It works as I want except
I wrote an adventure game in c and now I want to run that
I made a puzzle game using HTML5, just now I tried to add local
I wrote a game class with coffeescript that displays a plain and a rotating
Back in college I wrote a game where the computer would sleep for 1
I'm trying to re-implement an old Reversi board game I wrote with a bit
I am looking into making a text based game that I wrote in Haskell
I wrote this small game at http://amarnus.me/games/dodge . Now if you trying playing the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.