This commit is contained in:
Zeke Sikelianos 2017-12-14 17:09:59 -08:00 коммит произвёл Zeke Sikelianos
Родитель a76537816e
Коммит 6114056062
1 изменённых файлов: 13 добавлений и 21 удалений

Просмотреть файл

@ -58,39 +58,31 @@ app.use(browsersync())
// Routes
const routes = require('./routes')
app.get('/', routes.home)
app.get('/blog.xml', routes.feed.blog)
app.get('/blog.json', routes.feed.blog)
app.get('/apps', routes.apps.index)
app.get('/app/:slug', (req, res) => res.redirect(`/apps/${req.params.slug}`))
app.get('/apps', routes.apps.index)
app.get('/apps/:slug', routes.apps.show)
app.get('/docs/latest*', (req, res) => res.redirect(req.path.replace(/^\/docs\/latest/ig, '/docs')))
app.get('/docs/v0*', (req, res) => res.redirect(req.path.replace(/^\/docs\/v0\.\d+\.\d+/ig, '/docs')))
app.get('/awesome', (req, res) => res.redirect('/community'))
app.get('/blog.json', routes.feed.blog)
app.get('/blog.xml', routes.feed.blog)
app.get('/community', routes.community)
app.get('/contact', routes.contact)
app.get('/devtron', routes.devtron)
app.get('/docs', routes.docs.index)
app.get('/docs/:category', routes.docs.category)
app.get('/docs/:category/*', routes.docs.show)
app.get('/docs/latest*', (req, res) => res.redirect(req.path.replace(/^\/docs\/latest/ig, '/docs')))
app.get('/docs/v0*', (req, res) => res.redirect(req.path.replace(/^\/docs\/v0\.\d+\.\d+/ig, '/docs')))
app.get('/issues', (req, res) => res.redirect(301, 'https://github.com/electron/electronjs.org/issues'))
app.get('/issues/new', (req, res) => res.redirect(301, 'https://github.com/electron/electronjs.org/issues/new'))
app.get('/languages', routes.languages.index)
app.get('/maintainers/join', (req, res) => res.redirect('https://goo.gl/FJmZZm'))
app.get('/pulls', (req, res) => res.redirect(301, 'https://github.com/electron/electronjs.org/pulls'))
app.get('/releases', routes.releases)
app.get('/spectron', routes.spectron)
app.get('/userland', routes.userland.index)
app.get('/userland/*', routes.userland.show)
app.get('/maintainers/join', (req, res) => res.redirect('https://goo.gl/FJmZZm'))
app.get('/awesome', (req, res) => res.redirect('/community'))
app.get('/community', routes.community)
app.get('/languages', routes.languages.index)
app.get('/contact', routes.contact)
app.get('/releases', routes.releases)
app.get('/devtron', routes.devtron)
app.get('/spectron', routes.spectron)
app.use('/crowdin', routes.languages.proxy)
// Generic 404 handler
app.use(routes._404)
if (!module.parent) {