alphabetize routes
This commit is contained in:
Родитель
a76537816e
Коммит
6114056062
34
server.js
34
server.js
|
@ -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) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче