-
Notifications
You must be signed in to change notification settings - Fork 394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Gatsby migration fixes #1068
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
4eac356
Add 404 error code for not found page
psdcoder 800b828
Fix images loaded status checker for the right column in the document…
psdcoder 1715139
Move images helpers to 'src/utils'. Use these helpers for waiting ima…
psdcoder 9587977
Rename 'property' to 'name' attribute for description and keywords me…
psdcoder 6a69836
Remove duplication of modal root node
psdcoder 8344ef6
Use 'serve-handler' package for handling trailings slashed in the pro…
psdcoder 36da01d
Fix caption styles after code blocks in the docs
psdcoder ced9126
Remove wrapper for markdown component
psdcoder 6ad1293
Add compression middleware to server.js
psdcoder a46b442
Load algolia docsearch asynchronously to increase initial page load p…
psdcoder f21abfe
Add bundle-analyzer plugin to allow analyze result webpack bundles
psdcoder 52e8adb
Sentry: DVC-ORG-25. Use crossbrowser method of scrolling to necessary…
psdcoder 5c27568
Replace Promise polyfill with more lightweight version
psdcoder e920e2d
Sentry: DVC-ORG-27. Add polyfill for fetch (for IE 11)
psdcoder bc20a2d
Update license in the package.json
psdcoder File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 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
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,19 +1,47 @@ | ||
/* eslint-env node */ | ||
|
||
const express = require('express') | ||
const compression = require('compression') | ||
const serveHandler = require('serve-handler') | ||
|
||
const app = express() | ||
|
||
const apiMiddleware = require('./middleware/api') | ||
const redirectsMiddleware = require('./middleware/redirects') | ||
const notFoundMiddleware = require('./middleware/notFound') | ||
|
||
const port = process.env.PORT || 3000 | ||
|
||
app.use(compression()) | ||
app.use(redirectsMiddleware) | ||
app.use('/api', apiMiddleware) | ||
|
||
app.use(express.static('public', { cacheControl: true, maxAge: 0 })) | ||
|
||
app.use(notFoundMiddleware) | ||
app.use((req, res) => { | ||
serveHandler(req, res, { | ||
public: 'public', | ||
cleanUrls: true, | ||
trailingSlash: false, | ||
directoryListing: false, | ||
headers: [ | ||
{ | ||
source: '**/*.@(jpg|jpeg|gif|png)', | ||
headers: [ | ||
{ | ||
key: 'Cache-Control', | ||
value: 'max-age=86400' | ||
} | ||
] | ||
}, | ||
{ | ||
source: '!**/*.@(jpg|jpeg|gif|png)', | ||
headers: [ | ||
{ | ||
key: 'Cache-Control', | ||
value: 'max-age=0' | ||
} | ||
] | ||
} | ||
] | ||
}) | ||
}) | ||
|
||
app.listen(port, () => console.log(`Ready on localhost:${port}!`)) |
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
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fabiosantoscode could you please review this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fabiosantoscode ??