Created
June 9, 2015 00:17
-
-
Save DavidSouther/dd843dc33acbc9bcb25f to your computer and use it in GitHub Desktop.
Rupert Basic Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var config = { | |
name: "rupert-basic-example", | |
stassets: { | |
root: './src/client' | |
} | |
}; | |
require('rupert')(config).start(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html5> | |
<html lang="en"> | |
<head> | |
<title>Basic Demo</title> | |
<link rel="stylesheet" href="/all.css"/> | |
</head> | |
<body> | |
<h1 class="title">Rupert Basic Demo</h1> | |
<div> | |
<p>What's your name?</p> | |
<input id="name" /> | |
<p id="hello"></p> | |
</div> | |
<script src="/application.js"></script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener("DOMContentLoaded", function(event) { | |
document.getElementById('name').addEventListener('change', function(event){ | |
var name = event.target.value; | |
document.getElementById('hello').innerText = "Hello, " + name + "!"; | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"dependencies": { | |
"rupert": "0.3.x" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment