Permalink
Browse files

use http-route-proxy as static server

  • Loading branch information...
1 parent 1f6fd85 commit 63d58d3f317e0c063408c856400a4cec2348025e @switer committed Mar 11, 2014
Showing with 91 additions and 7 deletions.
  1. +2 −0 header/header.css
  2. +2 −2 header/header.js
  3. +7 −5 index.html
  4. +24 −0 package.json
  5. +48 −0 reset.css
  6. +8 −0 server/server.js
View
@@ -0,0 +1,2 @@
+.header {background-color: cornflowerblue; line-height: 40px; font-size: 16px; color: white; text-align: center}
+ .header .title {}
View
@@ -1,6 +1,6 @@
!function (exports) {
- Vue.component('vd-ello', {
- template: 'hello world',
+ Vue.component('vd-header', {
+ template: '#tpl-header',
data: {
title: '首页'
},
View
@@ -1,20 +1,22 @@
<!doctype html>
<html lang="en">
<head>
- <meta charset="UTF-8">
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0"/>
<title>Vue Demo -- the MVVM Framework</title>
+ <link rel="stylesheet" href="./reset.css">
<link rel="stylesheet" href="./common.css">
<link rel="stylesheet" href="./index/index.css">
<link rel="stylesheet" href="./header/header.css">
</head>
<body>
<script type="x-template" id='tpl-header'>
- <header class="header">
- <span>{{title}}</span>
- </header>
+ <div class="header">
+ <span class="title">{{title}}</span>
+ </div>
</script>
<div class="search" id="search" message="hellow world">
- <div v-component="vd-ello"></div>
+ <div v-component="vd-header"></div>
<div class="" >
<input type="text" class="search-input"
v-model="searchInput"
View
@@ -0,0 +1,24 @@
+{
+ "name": "vue-demo",
+ "version": "0.0.0",
+ "description": "vue demo",
+ "main": "index.html",
+ "scripts": {
+ "test": "npm test",
+ "start": "node server/server.js"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/switer/vue-demo.git"
+ },
+ "keywords": [
+ "vue",
+ "demo"
+ ],
+ "author": "switer",
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/switer/vue-demo/issues"
+ },
+ "homepage": "https://github.com/switer/vue-demo"
+}
View
@@ -0,0 +1,48 @@
+/* http://meyerweb.com/eric/tools/css/reset/
+ v2.0 | 20110126
+ License: none (public domain)
+*/
+
+html, body, div, span, applet, object, iframe,
+h1, h2, h3, h4, h5, h6, p, blockquote, pre,
+a, abbr, acronym, address, big, cite, code,
+del, dfn, em, img, ins, kbd, q, s, samp,
+small, strike, strong, sub, sup, tt, var,
+b, u, i, center,
+dl, dt, dd, ol, ul, li,
+fieldset, form, label, legend,
+table, caption, tbody, tfoot, thead, tr, th, td,
+article, aside, canvas, details, embed,
+figure, figcaption, footer, header, hgroup,
+menu, nav, output, ruby, section, summary,
+time, mark, audio, video {
+ margin: 0;
+ padding: 0;
+ border: 0;
+ font-size: 100%;
+ font: inherit;
+ vertical-align: baseline;
+}
+/* HTML5 display-role reset for older browsers */
+article, aside, details, figcaption, figure,
+footer, header, hgroup, menu, nav, section {
+ display: block;
+}
+body {
+ line-height: 1;
+}
+ol, ul {
+ list-style: none;
+}
+blockquote, q {
+ quotes: none;
+}
+blockquote:before, blockquote:after,
+q:before, q:after {
+ content: '';
+ content: none;
+}
+table {
+ border-collapse: collapse;
+ border-spacing: 0;
+}
View
@@ -0,0 +1,8 @@
+var Server = require('http-route-proxy');
+Server.proxy([
+{
+ from: 'localhost:3001',
+ to: 'https://github.com',
+ route: ['!/', '/api']
+}
+]);

0 comments on commit 63d58d3

Please sign in to comment.