-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
123 additions
and
2 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const { Controller } = require('egg'); | ||
|
||
class HomeController extends Controller { | ||
async index() { | ||
const { ctx } = this; | ||
ctx.body = 'hi, egg'; | ||
} | ||
} | ||
|
||
module.exports = HomeController; |
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 @@ | ||
/** | ||
* @param {Egg.Application} app - egg application | ||
*/ | ||
module.exports = app => { | ||
const { router, controller } = app; | ||
router.get('/', controller.home.index); | ||
}; |
28 changes: 28 additions & 0 deletions
28
test/fixtures/example-declarations/config/config.default.js
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,28 @@ | ||
/* eslint valid-jsdoc: "off" */ | ||
|
||
/** | ||
* @param {Egg.EggAppInfo} appInfo app info | ||
*/ | ||
module.exports = appInfo => { | ||
/** | ||
* built-in config | ||
* @type {Egg.EggAppConfig} | ||
**/ | ||
const config = exports = {}; | ||
|
||
// use for cookie sign key, should change to your own and keep security | ||
config.keys = appInfo.name + '_1704604037320_6202'; | ||
|
||
// add your middleware config here | ||
config.middleware = []; | ||
|
||
// add your user config here | ||
const userConfig = { | ||
// myAppName: 'egg', | ||
}; | ||
|
||
return { | ||
...config, | ||
...userConfig, | ||
}; | ||
}; |
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 @@ | ||
/** @type Egg.EggPlugin */ | ||
module.exports = { | ||
// had enabled by egg | ||
// static: { | ||
// enable: 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,5 @@ | ||
{ | ||
"include": [ | ||
"**/*" | ||
] | ||
} |
15 changes: 15 additions & 0 deletions
15
test/fixtures/example-declarations/node_modules/aliyun-egg/index.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
test/fixtures/example-declarations/node_modules/aliyun-egg/package.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "example-declarations", | ||
"version": "1.0.0", | ||
"description": "", | ||
"private": true, | ||
"egg": { | ||
"declarations": true, | ||
"framework": "aliyun-egg" | ||
} | ||
} |