I'm trying to serve a test file with some javascript. My test site is loading, but the JS isn't loading with it (if I look in the devloper's console, I see there's a 404 error -- but the path is right). I first tried keeping everything in root.
edited: as loki pointed out this way is wrong
I also tried keeping everything in a file called static (except for the yaml file which was outside)
application: test
version: 1
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /
static_files: static/test.html
upload: static/test.html
HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
<head>
<script type="text/javascript" src="static/script.js"></script>
</head>
<body>
<!-- content -->
</body>
</html>
Can anyone see what I'm missing? I'm having trouble understanding why it won't see my javascript.
Update:
application: test
version: 1
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /
static_files: static/test.html
upload: static/test.html
- url: /static
static_dir: static
this fixes it. the second handle picks up the javascript (and everything else in static, i think)