-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switched out Koa-frouter for Koa-Router
- Loading branch information
1 parent
209bf76
commit 0504117
Showing
13 changed files
with
56 additions
and
13 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,5 +1,5 @@ | ||
'use strict'; | ||
|
||
exports.get = function *() { | ||
module.exports = function *() { | ||
yield this.render('about'); | ||
}; |
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,5 +1,5 @@ | ||
'use strict'; | ||
|
||
exports.get = function *() { | ||
module.exports = function *() { | ||
yield this.render('alpha'); | ||
}; |
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,5 +1,5 @@ | ||
'use strict'; | ||
|
||
exports.get = function *() { | ||
module.exports = function *() { | ||
yield this.render('ambassadors'); | ||
}; |
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,5 +1,5 @@ | ||
'use strict'; | ||
|
||
exports.get = function *() { | ||
module.exports = function *() { | ||
yield this.render('commands'); | ||
}; |
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,5 +1,5 @@ | ||
'use strict'; | ||
|
||
exports.get = function *() { | ||
module.exports = function *() { | ||
yield this.render('donations'); | ||
}; |
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,5 +1,5 @@ | ||
'use strict'; | ||
|
||
exports.get = function *() { | ||
module.exports = function *() { | ||
yield this.render('features'); | ||
}; |
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,5 +1,36 @@ | ||
'use strict'; | ||
|
||
exports.get = function *() { | ||
yield this.render('index'); | ||
}; | ||
/* Route Dependencies */ | ||
|
||
const bodyParser = require('koa-body-parser'); | ||
const router = require('koa-router')(); | ||
|
||
/* Route Files */ | ||
const about = require('./about'); | ||
const alpha = require('./alpha'); | ||
const ambassadors = require('./ambassadors'); | ||
const commands = require('./commands'); | ||
const donations = require('./donations'); | ||
const features = require('./features'); | ||
const index = require('./index/'); | ||
const install = require('./install'); | ||
const lang = require('./lang'); | ||
const license = require('./license'); | ||
const readme = require('./readme'); | ||
const translate = require('./translate'); | ||
|
||
/* Routes */ | ||
router.get('/', index); | ||
router.get('/about', about); | ||
router.get('/alpha', alpha); | ||
router.get('/ambassadors', ambassadors); | ||
router.get('/commands', commands); | ||
router.get('/donations', donations); | ||
router.get('/features', features); | ||
router.get('/install', install); | ||
router.post('/lang', bodyParser(), lang); | ||
router.get('/license', license); | ||
router.get('/readme', readme); | ||
router.get('/translate', translate); | ||
|
||
module.exports = router; |
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,5 @@ | ||
'use strict'; | ||
|
||
module.exports = function *() { | ||
yield this.render('index'); | ||
}; |
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,5 +1,5 @@ | ||
'use strict'; | ||
|
||
exports.get = function *() { | ||
module.exports = function *() { | ||
yield this.render('install'); | ||
}; |
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,7 @@ | ||
'use strict'; | ||
|
||
module.exports = function *(next) { | ||
const lang = this.request.body && this.request.body.lang || 'en'; | ||
this.cookies.set('locale', lang); | ||
this.status = 200; | ||
}; |
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,5 +1,5 @@ | ||
'use strict'; | ||
|
||
exports.get = function *() { | ||
module.exports = function *() { | ||
yield this.render('license'); | ||
}; |
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,5 +1,5 @@ | ||
'use strict'; | ||
|
||
exports.get = function *() { | ||
module.exports = function *() { | ||
yield this.render('install'); | ||
}; |
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,5 +1,5 @@ | ||
'use strict'; | ||
|
||
exports.get = function *() { | ||
module.exports = function *() { | ||
yield this.render('translators'); | ||
}; |