Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
CoCo_Code_Op2
next.js
提交
6b7864e5
N
next.js
项目概览
CoCo_Code_Op2
/
next.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
N
next.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6b7864e5
编写于
12月 10, 2018
作者:
T
Tim Neutkens
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix linting
上级
616c3d7a
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
53 addition
and
52 deletion
+53
-52
examples/with-firebase-hosting-and-docker/next.config.js
examples/with-firebase-hosting-and-docker/next.config.js
+2
-2
examples/with-firebase-hosting-and-docker/src/app/components/App.js
...ith-firebase-hosting-and-docker/src/app/components/App.js
+8
-8
examples/with-firebase-hosting-and-docker/src/app/components/Header.js
...-firebase-hosting-and-docker/src/app/components/Header.js
+10
-10
examples/with-firebase-hosting-and-docker/src/app/pages/about.js
...s/with-firebase-hosting-and-docker/src/app/pages/about.js
+3
-3
examples/with-firebase-hosting-and-docker/src/app/pages/index.js
...s/with-firebase-hosting-and-docker/src/app/pages/index.js
+3
-3
examples/with-firebase-hosting-and-docker/src/functions/index.js
...s/with-firebase-hosting-and-docker/src/functions/index.js
+21
-21
examples/with-firebase-hosting-and-docker/src/functions/lib/firebase.js
...firebase-hosting-and-docker/src/functions/lib/firebase.js
+4
-4
examples/with-relay-modern-server-express/lib/createRelayEnvironment.js
...relay-modern-server-express/lib/createRelayEnvironment.js
+1
-1
package.json
package.json
+1
-0
未找到文件。
examples/with-firebase-hosting-and-docker/next.config.js
浏览文件 @
6b7864e5
module
.
exports
=
{
distDir
:
'
../../dist/functions/next
'
,
}
;
distDir
:
'
../../dist/functions/next
'
}
examples/with-firebase-hosting-and-docker/src/app/components/App.js
浏览文件 @
6b7864e5
import
React
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
Header
from
'
./Header
'
;
import
React
from
'
react
'
import
PropTypes
from
'
prop-types
'
import
Header
from
'
./Header
'
const
propTypes
=
{
children
:
PropTypes
.
element
,
}
;
children
:
PropTypes
.
element
}
const
App
=
({
children
})
=>
(
<
main
>
<
Header
/>
{
children
}
<
/main
>
)
;
)
App
.
propTypes
=
propTypes
;
App
.
propTypes
=
propTypes
export
default
App
;
export
default
App
examples/with-firebase-hosting-and-docker/src/app/components/Header.js
浏览文件 @
6b7864e5
import
React
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
Link
from
'
next/link
'
;
import
React
from
'
react
'
import
PropTypes
from
'
prop-types
'
import
Link
from
'
next/link
'
const
propTypes
=
{
pathname
:
PropTypes
.
String
,
}
;
pathname
:
PropTypes
.
String
}
const
Header
=
({
pathname
})
=>
(
<
header
>
<
Link
href
=
"
/
"
>
<
Link
href
=
'
/
'
>
<
a
className
=
{
pathname
===
'
/
'
?
'
is-active
'
:
''
}
>
Home
<
/a
>
<
/Link
>
<
span
>
-
<
/span
>
<
Link
href
=
"
/about
"
>
<
Link
href
=
'
/about
'
>
<
a
className
=
{
pathname
===
'
/about
'
?
'
is-active
'
:
''
}
>
About
<
/a
>
<
/Link
>
<
/header
>
)
;
)
Header
.
propTypes
=
propTypes
;
Header
.
propTypes
=
propTypes
export
default
Header
;
export
default
Header
examples/with-firebase-hosting-and-docker/src/app/pages/about.js
浏览文件 @
6b7864e5
import
*
as
React
from
'
react
'
;
import
App
from
'
../components/App
'
;
import
*
as
React
from
'
react
'
import
App
from
'
../components/App
'
export
default
()
=>
(
<
App
>
<
p
>
About
Page
<
/p
>
<
/App
>
)
;
)
examples/with-firebase-hosting-and-docker/src/app/pages/index.js
浏览文件 @
6b7864e5
import
*
as
React
from
'
react
'
;
import
App
from
'
../components/App
'
;
import
*
as
React
from
'
react
'
import
App
from
'
../components/App
'
export
default
()
=>
(
<
App
>
<
p
>
Index
Page
<
/p
>
<
/App
>
)
;
)
examples/with-firebase-hosting-and-docker/src/functions/index.js
浏览文件 @
6b7864e5
/* eslint-disable import/no-unresolved,import/extensions */
import
next
from
'
next
'
;
import
express
from
'
express
'
;
import
compression
from
'
compression
'
;
import
helmet
from
'
helmet
'
;
import
cors
from
'
cors
'
;
import
bodyParser
from
'
body-parser
'
;
import
{
functions
}
from
'
./lib/firebase
'
;
import
next
from
'
next
'
import
express
from
'
express
'
import
compression
from
'
compression
'
import
helmet
from
'
helmet
'
import
cors
from
'
cors
'
import
bodyParser
from
'
body-parser
'
import
{
functions
}
from
'
./lib/firebase
'
const
nextApp
=
next
({
dev
:
false
,
conf
:
{
distDir
:
'
next
'
}
})
;
const
handle
=
nextApp
.
getRequestHandler
()
;
const
nextApp
=
next
({
dev
:
false
,
conf
:
{
distDir
:
'
next
'
}
})
const
handle
=
nextApp
.
getRequestHandler
()
const
server
=
express
()
;
server
.
disable
(
'
x-powered-by
'
)
;
server
.
use
(
cors
())
;
server
.
use
(
bodyParser
.
json
())
;
server
.
set
(
'
trust proxy
'
,
1
)
;
server
.
use
(
compression
())
;
server
.
use
(
helmet
())
;
const
server
=
express
()
server
.
disable
(
'
x-powered-by
'
)
server
.
use
(
cors
())
server
.
use
(
bodyParser
.
json
())
server
.
set
(
'
trust proxy
'
,
1
)
server
.
use
(
compression
())
server
.
use
(
helmet
())
server
.
get
(
'
*
'
,
(
req
,
res
)
=>
handle
(
req
,
res
))
;
server
.
get
(
'
*
'
,
(
req
,
res
)
=>
handle
(
req
,
res
))
const
app
=
functions
.
https
.
onRequest
(
async
(
req
,
res
)
=>
{
await
nextApp
.
prepare
()
;
return
server
(
req
,
res
)
;
})
;
await
nextApp
.
prepare
()
return
server
(
req
,
res
)
})
export
{
app
}
;
export
{
app
}
examples/with-firebase-hosting-and-docker/src/functions/lib/firebase.js
浏览文件 @
6b7864e5
import
admin
from
'
firebase-admin
'
;
import
*
as
functions
from
'
firebase-functions
'
;
import
admin
from
'
firebase-admin
'
import
*
as
functions
from
'
firebase-functions
'
export
{
functions
}
;
export
const
firebase
=
admin
.
initializeApp
()
;
export
{
functions
}
export
const
firebase
=
admin
.
initializeApp
()
examples/with-relay-modern-server-express/lib/createRelayEnvironment.js
浏览文件 @
6b7864e5
...
...
@@ -9,7 +9,7 @@ function fetchQuery (
operation
,
variables
,
cacheConfig
,
uploadables
,
uploadables
)
{
// Because we implement the graphql server, the client must to point to the same host
const
relayServer
=
process
.
browser
?
''
:
process
.
env
.
RELAY_SERVER
...
...
package.json
浏览文件 @
6b7864e5
...
...
@@ -14,6 +14,7 @@
"test"
:
"npm run testall || npm run testall"
,
"coveralls"
:
"cat ./test/coverage/lcov.info | coveralls"
,
"lint"
:
"lerna run typescript && standard && standard --parser typescript-eslint-parser --plugin typescript packages/**/*.ts"
,
"lint-fix"
:
"standard --fix && standard --fix --parser typescript-eslint-parser --plugin typescript packages/**/*.ts"
,
"typescript"
:
"lerna run typescript"
,
"prepublish"
:
"lerna run prepublish"
,
"publish-canary"
:
"lerna version prerelease --preid canary --force-publish"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录