Skip to content

Commit

Permalink
v0.1.3 -- 修复代码发布后,无法启动服务的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
eteplus committed Mar 28, 2016
1 parent 8aab42d commit 14e050f
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 15 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,10 @@
- 按需加载组件

-------

#### v0.1.3 ( 2016-3-28 ) ####
- 修改静态资源目录
- 修改vue-resource的root设置
- 修复代码发布后, 无法运行服务的问题

------
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
Vue很轻量,易定制,比较适合移动端,很喜欢Vue写组件的方式,
所有用[VUE](http://cn.vuejs.org/)[SUI-Mobile](http://m.sui.taobao.org/) 写了一个移动端demo,用来反馈vue的学习成果(禁用了SUI自带的路由,使用[Vue-router](https://github.com/vuejs/vue-router)

##### 环境
1. node v5.5.0
2. npm 3.3.9

##### 技术栈

Expand Down
2 changes: 2 additions & 0 deletions build/dev-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ var app = express()
var compiler = webpack(config)
// 设置资源目录
app.use('/static', express.static(path.join(__dirname, '../src')))
app.use('/data', express.static(path.join(__dirname, '../src/data')))
app.use('/img', express.static(path.join(__dirname, '../src/assets/img')))

app.use(favicon(path.join(__dirname, '../favicon.ico')))
// handle fallback for HTML5 history API
Expand Down
23 changes: 13 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
var express = require('express');
var path = require('path');
var app = express();
var express = require('express')
var path = require('path')
var app = express()
var favicon = require('express-favicon')

app.use('/static', express.static(path.join(__dirname, './dist/static')));
app.use('/static', express.static(path.join(__dirname, './dist/static/')))
app.use('/data', express.static(path.join(__dirname, './src/data')))
app.use('/img', express.static(path.join(__dirname, './src/assets/img')))

app.use(favicon(path.join(__dirname, './favicon.ico')))

app.get('/', function (req, res) {
res.sendFile('index.html', { root: path.join(__dirname, './dist') });
});
res.sendFile('index.html', { root: path.join(__dirname, './dist') })
})

var server = app.listen(3030, '127.0.0.1', function () {

var host = server.address().address;
var port = server.address().port;
var host = server.address().address
var port = server.address().port

console.log('vue-sui-demo listening at http://%s:%s', host, port);
console.log('vue-sui-demo listening at http://%s:%s', host, port)

});
})
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vue-sui-demo",
"description": "vue combine with sui-mobile",
"author": "eteplus <[email protected]>",
"version": "0.1.2",
"version": "0.1.3",
"scripts": {
"main": "node index.js",
"dev": "node build/dev-server.js",
Expand Down
2 changes: 1 addition & 1 deletion src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ routerConfig(router)
// Resource
Vue.use(VueResource)

Vue.http.options.root = '/static/data'
Vue.http.options.root = '/data/'
Vue.http.options.emulateJSON = true

// Directive
Expand Down
6 changes: 3 additions & 3 deletions src/data/banner.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"message": "获取成功",
"data": [
{
"content": "/static/assets/img/1.jpg"
"content": "/img/1.jpg"
},
{
"content": "/static/assets/img/1.jpg"
"content": "/img/1.jpg"
},
{
"content": "/static/assets/img/1.jpg"
"content": "/img/1.jpg"
}
]
}

0 comments on commit 14e050f

Please sign in to comment.