add a static file example

This commit is contained in:
Maxime Bloch 2019-09-20 15:02:28 +02:00
parent 9b3e71c496
commit a27a5e9370
No known key found for this signature in database
GPG key ID: CE32A7D95B7D6418
4 changed files with 15 additions and 5 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
__pycache__/ __pycache__/
venv/ venv/
.tern-port

3
watcher/static/hello.js Normal file
View file

@ -0,0 +1,3 @@
function sayHello() {
alert("Hello World");
}

3
watcher/static/index.css Normal file
View file

@ -0,0 +1,3 @@
h1 {
color: blue;
}

View file

@ -1,7 +1,10 @@
<html> <html>
<head> <head>
<script type = "text/javascript"
src = "{{ url_for('static', filename = 'hello.js') }}" ></script>
</head> </head>
<body> <body>
<h1>TEST</h1> <input type = "button" onclick = "sayHello()" value = "Say Hello" />
</body> </body>
</html> </html>