Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Thermostat/web-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM httpd:2.4
COPY ./public-html/ /usr/local/apache2/htdocs/
23 changes: 23 additions & 0 deletions Thermostat/web-service/public-html/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<script src="https://www.gstatic.com/firebasejs/3.4.1/firebase.js"></script>
<script>
// Initialize Firebase
var config = {
apiKey: "AIzaSyCbypyfXPs0URlzy6N8Wo8EGZ_4xk4Eby4",
authDomain: "thermostat-1d90c.firebaseapp.com",
databaseURL: "https://thermostat-1d90c.firebaseio.com",
storageBucket: "thermostat-1d90c.appspot.com",
messagingSenderId: "1038669911500"
};
var mainApp = firebase.initializeApp(config);
var tempRef = firebase.database().ref('temp/');
tempRef.on('value', function(shapshot) {
onNewTemp(shapshot.val());
});
pushNewTemp = function(temp){
tempRef.set(temp);
}
onNewTemp = function(temp){
console.log(temp);
//Your code here
}
</script>
2 changes: 2 additions & 0 deletions Thermostat/web-service/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
docker build -t thermostat-webserver .
docker run -p 80:80 thermostat-webserver