Add hot reloading to application using browser-sync

* Remove all the now unnecessary server code.
This commit is contained in:
Julien Lengrand-Lambert
2017-06-07 16:51:44 +02:00
parent 0516376932
commit b071cc16d3
7 changed files with 15 additions and 24 deletions

View File

@@ -1,4 +1,4 @@
<link rel="import" href="../../../bower_components/polymer/polymer.html">
<link rel="import" href="/polymer/polymer.html">
<dom-module id="sc-player">
<template>
@@ -12,7 +12,7 @@
<iframe
width="100%"
height="450"
height="800"
scrolling="no"
frameborder="no"
src="https://w.soundcloud.com/player/?url={{encodedPlaylistUrl}}&amp;auto_play={{autoPlay}}&amp;hide_related={{hideRelated}}&amp;show_comments={{showComments}}&amp;show_user={{showUser}}&amp;show_reposts={{showReposts}}&amp;visual={{visual}}">

View File

@@ -1,4 +1,4 @@
<link rel="import" href="../../../bower_components/polymer/polymer.html">
<link rel="import" href="/polymer/polymer.html">
<dom-module id="sc-profile">
<template>

View File

@@ -1,4 +1,4 @@
<link rel="import" href="../../../bower_components/polymer/polymer.html">
<link rel="import" href="/polymer/polymer.html">
<dom-module id="sc-title">
<template>

View File

@@ -4,13 +4,14 @@
<meta charset="utf-8"/>
<title>Soundcloud Playlist, featuring Polymer</title>
</head>
<script src="../bower_components/webcomponentsjs/webcomponents-lite.js"></script>
<script src="webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="../app/components/sc-title/sc-title.html">
<link rel="import" href="../app/components/sc-profile/sc-profile.html">
<link rel="import" href="../app/components/sc-player/sc-player.html">
<link rel="import" href="components/sc-title/sc-title.html">
<link rel="import" href="components/sc-profile/sc-profile.html">
<link rel="import" href="components/sc-player/sc-player.html">
<body>
<h1>PLOP</h1>
<sc-title></sc-title>
<sc-profile></sc-profile>
<sc-player playlist-url="https://soundcloud.com/stuart-silva-322219159/sets/romantic-songs-mariela"></sc-player>

View File

@@ -10,5 +10,8 @@
"bower_components",
"test",
"tests"
]
],
"devDependencies": {
"webcomponentsjs": "^1.0.1"
}
}

View File

@@ -3,17 +3,15 @@
"version": "1.0.0",
"description": "A simple website with a soundcloud player, built using web components (polymer)",
"private": true,
"main": "server/app.js",
"scripts": {
"start": "nodemon -e .js,.html server/app.js",
"start": "browser-sync start --server app -f app --serveStatic bower_components --no-notify",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Julien Lengrand-Lambert <julien.lengrand-lambert@ing.nl>",
"license": "ISC",
"devDependencies": {
"nodemon": "^1.11.0"
"browser-sync": "^2.18.12"
},
"dependencies": {
"express": "^4.15.3"
}
}

View File

@@ -1,11 +0,0 @@
var express = require("../node_modules/express");
var app = express();
var path = require("path");
app.get('/', function(req, res){
res.sendFile(path.join(__dirname + '/../app/index.html'));
});
app.use(express.static(path.join(__dirname, '../')));
var http = require('http').Server(app);
http.listen(8080);