-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1244 from artsy/staging
Deploy
- Loading branch information
Showing
126 changed files
with
2,139 additions
and
856 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,25 @@ | ||
{} | ||
{ | ||
"presets": [ | ||
"es2015", | ||
"react", | ||
"stage-3" | ||
], | ||
"plugins": [ | ||
"babel-plugin-rewire", | ||
"inline-react-svg", | ||
"transform-runtime", | ||
["module-resolver", { | ||
"root": ["./"] | ||
}], | ||
"transform-class-properties" | ||
], | ||
"env": { | ||
"development": { | ||
"plugins": [ | ||
["styled-components", { | ||
"ssr": true | ||
}] | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
npm-debug.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"parser": "babel-eslint", | ||
"extends": [ | ||
"standard", | ||
"standard-react" | ||
], | ||
"globals": { | ||
__dirname: true | ||
}, | ||
"env": { | ||
"browser": true, | ||
"mocha": true, | ||
"node": true | ||
}, | ||
"rules": { | ||
"camelcase": 0, | ||
"no-mixed-operators": 0, | ||
"no-new": 0, | ||
"react/jsx-indent": 0 | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,4 @@ dump.rdb | |
.env.ignore | ||
node_modules | ||
.vscode | ||
data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM node:7 | ||
RUN mkdir -p /usr/src/app | ||
WORKDIR /usr/src/app | ||
COPY package.json . | ||
RUN yarn install | ||
COPY . . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/** | ||
* Main server that combines API & client | ||
*/ | ||
|
||
import artsyXapp from 'artsy-xapp' | ||
import express from 'express' | ||
import newrelic from 'artsy-newrelic' | ||
import path from 'path' | ||
import { IpFilter } from 'express-ipfilter' | ||
import { createReloadable, isDevelopment } from '@artsy/express-reloadable' | ||
|
||
const debug = require('debug')('app') | ||
const app = module.exports = express() | ||
|
||
// Blacklist ips | ||
app.use( | ||
IpFilter([process.env.IP_BLACKLIST.split(',')], { log: false, mode: 'deny' }) | ||
) | ||
|
||
// Get an xapp token | ||
const xappConfig = { | ||
url: process.env.ARTSY_URL, | ||
id: process.env.ARTSY_ID, | ||
secret: process.env.ARTSY_SECRET | ||
} | ||
|
||
artsyXapp.init(xappConfig, () => { | ||
app.use(newrelic) | ||
|
||
if (isDevelopment) { | ||
const reloadAndMount = createReloadable(app, require) | ||
|
||
// Enable server-side code hot-swapping on change | ||
app.use('/api', reloadAndMount(path.resolve(__dirname, 'api'), { | ||
mountPoint: '/api' | ||
})) | ||
|
||
invalidateUserMiddleware(app) | ||
reloadAndMount(path.resolve(__dirname, 'client')) | ||
|
||
// Staging, Prod | ||
} else { | ||
app.use('/api', require('./api')) | ||
invalidateUserMiddleware(app) | ||
app.use(require('./client')) | ||
} | ||
|
||
// Start the server and send a message to IPC for the integration test | ||
// helper to hook into. | ||
app.listen(process.env.PORT, () => { | ||
debug(`Listening on port ${process.env.PORT}`) | ||
|
||
if (typeof process.send === 'function') { | ||
process.send('listening') | ||
} | ||
}) | ||
}) | ||
|
||
// Crash if we can't get/refresh an xapp token | ||
artsyXapp.on('error', (error) => { | ||
console.warn(error) | ||
process.exit(1) | ||
}) | ||
|
||
const invalidateUserMiddleware = (app) => { | ||
app.use((req, rest, next) => { | ||
req.user = null | ||
next() | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.