Merge branch 'master' into multi-file-upload
This commit is contained in:
commit
2db7e194b4
@ -18,19 +18,17 @@
|
||||
"koa-router": "^7.1.1",
|
||||
"rethinkdbdash": "^2.3.28",
|
||||
"source-map-support": "^0.4.14",
|
||||
"webpack": "^2.3.2",
|
||||
"webpack": "^2.3.3",
|
||||
"zoo": "^0.1.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-cli": "^6.24.0",
|
||||
"babel-eslint": "^7.2.1",
|
||||
"chalk": "^1.1.3",
|
||||
"indent-string": "^3.1.0",
|
||||
"standard": "^9.0.2"
|
||||
"standard": "^9.0.2",
|
||||
"webpack-watch-server": "^1.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "standard",
|
||||
"dev": "zoo babel-node scripts/dev",
|
||||
"dev": "zoo webpack-watch-server",
|
||||
"build": "zoo webpack",
|
||||
"start": "zoo node dist"
|
||||
},
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# Apollo upload examples API
|
||||
# Apollo upload example API
|
||||
|
||||
An example GraphQL API using [Apollo upload server](https://github.com/jaydenseric/apollo-upload-server).
|
||||
|
||||
|
||||
@ -1,49 +0,0 @@
|
||||
import 'source-map-support/register'
|
||||
import {spawn} from 'child_process'
|
||||
import chalk from 'chalk'
|
||||
import indentString from 'indent-string'
|
||||
import webpack from 'webpack'
|
||||
import webpackConfig from '../webpack.config.babel'
|
||||
|
||||
let serverProcess
|
||||
let wasServerMessage
|
||||
|
||||
function startServer () {
|
||||
serverProcess = spawn('node', [webpackConfig.output.path])
|
||||
serverProcess.stdout.on('data', data => {
|
||||
console.log((wasServerMessage ? '' : '\n') + indentString(chalk.white(data), 4))
|
||||
wasServerMessage = true
|
||||
})
|
||||
serverProcess.stderr.on('data', data => {
|
||||
console.error((wasServerMessage ? '' : '\n') + indentString(chalk.red(data), 4))
|
||||
wasServerMessage = true
|
||||
})
|
||||
}
|
||||
|
||||
function stopServer () {
|
||||
if (serverProcess) serverProcess.kill()
|
||||
}
|
||||
|
||||
const compiler = webpack(webpackConfig)
|
||||
const watcher = compiler.watch({}, (errors, stats) => {
|
||||
const hasErrors = errors || stats.hasErrors()
|
||||
console[hasErrors ? 'error' : 'log']((stats.toString('minimal')))
|
||||
wasServerMessage = false
|
||||
|
||||
stopServer()
|
||||
if (!hasErrors) startServer()
|
||||
})
|
||||
|
||||
function exit () {
|
||||
watcher.close()
|
||||
stopServer()
|
||||
}
|
||||
|
||||
;[
|
||||
'SIGINT',
|
||||
'SIGTERM',
|
||||
'SIGHUP',
|
||||
'SIGQUIT',
|
||||
'exit',
|
||||
'uncaughtException'
|
||||
].forEach(event => process.on(event, exit))
|
||||
0
client/.gitignore → app/.gitignore
vendored
0
client/.gitignore → app/.gitignore
vendored
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "apollo-upload-examples-client",
|
||||
"name": "apollo-upload-examples-app",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"apollo-upload-client": "^3.0.1",
|
||||
@ -1,6 +1,6 @@
|
||||
# Apollo upload examples client
|
||||
# Apollo upload example web application
|
||||
|
||||
An example [Next.js](https://github.com/zeit/next.js) [React Apollo client](http://dev.apollodata.com/react) using [Apollo upload client](https://github.com/jaydenseric/apollo-upload-client).
|
||||
An example web application using [Next.js](https://github.com/zeit/next.js), [React Apollo client](http://dev.apollodata.com/react) and [Apollo upload client](https://github.com/jaydenseric/apollo-upload-client).
|
||||
|
||||
## Setup
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# 
|
||||
# 
|
||||
|
||||
  
|
||||
|
||||
@ -8,4 +8,4 @@ An example GraphQL API using [Apollo upload server](https://github.com/jaydenser
|
||||
|
||||
## Setup
|
||||
|
||||
See readmes in `/client` and `/api`.
|
||||
See readmes in `/api` and `/app`.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user