Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
凌波微步_大先生
dashboard
提交
7e1b6030
D
dashboard
项目概览
凌波微步_大先生
/
dashboard
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dashboard
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7e1b6030
编写于
11月 10, 2015
作者:
P
Piotr Bryk
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into update-node-sass
上级
234642ff
4c70ee95
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
25 addition
and
14 deletion
+25
-14
build/build.js
build/build.js
+2
-2
build/conf.js
build/conf.js
+1
-0
build/index.js
build/index.js
+1
-1
build/serve.js
build/serve.js
+19
-9
src/app/backend/dashboard.go
src/app/backend/dashboard.go
+2
-2
未找到文件。
build/build.js
浏览文件 @
7e1b6030
...
...
@@ -77,7 +77,7 @@ gulp.task('build-frontend', ['assets', 'index:prod'], function () {
quotes
:
true
,
}))
.
pipe
(
htmlFilter
.
restore
)
.
pipe
(
gulp
.
dest
(
conf
.
paths
.
dist
));
.
pipe
(
gulp
.
dest
(
conf
.
paths
.
dist
Public
));
});
...
...
@@ -86,7 +86,7 @@ gulp.task('build-frontend', ['assets', 'index:prod'], function () {
*/
gulp
.
task
(
'
assets
'
,
function
()
{
return
gulp
.
src
(
path
.
join
(
conf
.
paths
.
assets
,
'
/**/*
'
),
{
base
:
conf
.
paths
.
app
})
.
pipe
(
gulp
.
dest
(
conf
.
paths
.
dist
));
.
pipe
(
gulp
.
dest
(
conf
.
paths
.
dist
Public
));
});
...
...
build/conf.js
浏览文件 @
7e1b6030
...
...
@@ -80,6 +80,7 @@ export default {
build
:
path
.
join
(
basePath
,
'
build
'
),
deploySrc
:
path
.
join
(
basePath
,
'
src/app/deploy
'
),
dist
:
path
.
join
(
basePath
,
'
dist
'
),
distPublic
:
path
.
join
(
basePath
,
'
dist/public
'
),
externs
:
path
.
join
(
basePath
,
'
src/app/externs
'
),
frontendSrc
:
path
.
join
(
basePath
,
'
src/app/frontend
'
),
frontendTest
:
path
.
join
(
basePath
,
'
src/test/frontend
'
),
...
...
build/index.js
浏览文件 @
7e1b6030
...
...
@@ -43,7 +43,7 @@ function createIndexFile(indexPath) {
let
wiredepOptions
=
{
// Make wiredep dependencies begin with "bower_components/" not "../../...".
ignorePath
:
path
.
relative
(
conf
.
paths
.
frontendSrc
,
conf
.
paths
.
base
)
+
'
/
'
,
ignorePath
:
path
.
relative
(
conf
.
paths
.
frontendSrc
,
conf
.
paths
.
base
),
};
return
gulp
.
src
(
path
.
join
(
conf
.
paths
.
frontendSrc
,
'
index.html
'
))
...
...
build/serve.js
浏览文件 @
7e1b6030
...
...
@@ -39,24 +39,36 @@ let runningBackendProcess = null;
/**
* Initializes BrowserSync tool. Files are server from baseDir directory list.
* Initializes BrowserSync tool. Files are server from baseDir directory list. When
* includeBowerComponents is true, requests for paths starting with '/bower_components' are
* routed to bower components directory.
*
* @param {!Array<string>|string} baseDir
* @param {boolean} includeBowerComponents
*/
function
browserSyncInit
(
baseDir
)
{
function
browserSyncInit
(
baseDir
,
includeBowerComponents
)
{
// Enable custom support for Angular apps, e.g., history management.
browserSyncInstance
.
use
(
browserSyncSpa
({
selector
:
'
[ng-app]
'
,
}));
browserSyncInstance
.
init
({
let
config
=
{
browser
:
[],
// Needed so that the browser does not auto-launch.
directory
:
false
,
// Disable directory listings.
// TODO(bryk): Add proxy to the backend here.
startPath
:
'
/
'
,
server
:
{
baseDir
:
baseDir
,
},
browser
:
[],
// Needed so that the browser does not auto-launch.
});
};
if
(
includeBowerComponents
)
{
config
.
server
.
routes
=
{
'
/bower_components
'
:
conf
.
paths
.
bowerComponents
,
};
}
browserSyncInstance
.
init
(
config
);
}
...
...
@@ -68,8 +80,7 @@ function serveDevelopmentMode() {
conf
.
paths
.
serve
,
conf
.
paths
.
frontendSrc
,
// For angular templates to work.
conf
.
paths
.
app
,
// For assets to work.
conf
.
paths
.
base
,
// For bower dependencies to work.
]);
],
true
);
}
...
...
@@ -90,7 +101,7 @@ gulp.task('serve', ['index'], serveDevelopmentMode);
* Serves the application in production mode.
*/
gulp
.
task
(
'
serve:prod
'
,
[
'
build-frontend
'
],
function
()
{
browserSyncInit
(
conf
.
paths
.
dist
);
browserSyncInit
(
conf
.
paths
.
dist
Public
,
false
);
});
...
...
@@ -155,4 +166,3 @@ gulp.task('watch', ['index'], function () {
gulp
.
watch
(
path
.
join
(
conf
.
paths
.
frontendSrc
,
'
**/*.js
'
),
[
'
scripts
'
]);
gulp
.
watch
(
path
.
join
(
conf
.
paths
.
backendSrc
,
'
**/*.go
'
),
[
'
spawn-backend
'
]);
});
src/app/backend/dashboard.go
浏览文件 @
7e1b6030
...
...
@@ -51,9 +51,9 @@ func main() {
// Display Apiserver version. This is just for tests.
println
(
"Server API version: "
+
serverAPIVersion
.
GoString
())
// Run a HTTP server that serves static
files from current directory
and handles API calls.
// Run a HTTP server that serves static
public files from './public'
and handles API calls.
// TODO(bryk): Disable directory listing.
http
.
Handle
(
"/"
,
http
.
FileServer
(
http
.
Dir
(
"./"
)))
http
.
Handle
(
"/"
,
http
.
FileServer
(
http
.
Dir
(
"./
public
"
)))
http
.
Handle
(
"/api/"
,
createApiHandler
())
glog
.
Fatal
(
http
.
ListenAndServe
(
fmt
.
Sprintf
(
":%d"
,
*
argPort
),
nil
))
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录