express-spring-generator
v1.2.0
Published
The quickest way to get started express application with express-spring decorators
Maintainers
Readme
express-spring application generator
The quickest way to get started express application with express-spring decorators.
Installation
This is a generator based on Node.js.
Before installing, download and install Node.js. Node.js 18 or higher is required.
npm install -g express-spring-generatorQuick Start
Create the app:
express-spring new exampleInput the number of port or using default value (Supported in version 1.1.0 of generator):
? Please input port of the application (404)Start application at http://localhost:404/:
npm run startupCommands and Options
Commands:
controller <controller-name> Generate a restful controller in express-spring application
new [options] <project-name> Create a new express-spring applicationOptions:
-v, --version output the version number
-h, --help display help for command
-f, --force Overwrites existing directory without confirmation when creating new projectChange log
In express-spring 1.3.0
"Value" decorator will be supported.
JSON file in "values/example/message.json"
{
"value": "This is an example of using Value decorator!"
}Extract data from "values/example/message.json" in Rest Controller
@RestController
export class ValueController {
@Value('example.message.value')
private value: string;
@GetMapping('/value')
getValue() {
// "this.value" will be "This is an example of using Value decorator!"
return this.value;
}
}"ValuesFolder" can be set in application.config.json
Default value is "values", to define the folder for storing JSON format data and extract them by "Value" decorator.
Developers
The original author of Express Spring Generator is Xu Ming
List of all contributors
