|
| 1 | + |
| 2 | +# Tencent-scf - Create |
| 3 | + |
| 4 | +Creates a new service in the current working directory based on the provided template. |
| 5 | + |
| 6 | +**Create service in current working directory:** |
| 7 | + |
| 8 | +```bash |
| 9 | +serverless create --template tencent-nodejs |
| 10 | +``` |
| 11 | + |
| 12 | +**Create service in new folder:** |
| 13 | + |
| 14 | +```bash |
| 15 | +serverless create --template tencent-nodejs --path myService |
| 16 | +``` |
| 17 | + |
| 18 | +**Create service in new folder using a custom template:** |
| 19 | + |
| 20 | +```bash |
| 21 | +serverless create --template-url https://github.com/serverless/serverless/tree/master/lib/plugins/create/templates/tencent-nodejs --path myService |
| 22 | +``` |
| 23 | +## Options |
| 24 | + |
| 25 | +- `--template` or `-t` The name of one of the available templates. **Required if --template-url and --template-path are not present**. |
| 26 | +- `--template-url` or `-u` The name of one of the available templates. **Required if --template and --template-path are not present**. |
| 27 | +- `--template-path` The local path of your template. **Required if --template and --template-url are not present**. |
| 28 | +- `--path` or `-p` The path where the service should be created. |
| 29 | +- `--name` or `-n` the name of the service in `serverless.yml`. |
| 30 | + |
| 31 | +## Available Templates |
| 32 | + |
| 33 | +To see a list of available templates run `serverless create --help` |
| 34 | + |
| 35 | +Most commonly used templates: |
| 36 | + |
| 37 | +- tencent-nodejs |
| 38 | +- tencent-python |
| 39 | +- tencent-php |
| 40 | +- tencent-go |
| 41 | + |
| 42 | +## Examples |
| 43 | + |
| 44 | +### Creating a new service |
| 45 | + |
| 46 | +```bash |
| 47 | +serverless create --template tencent-nodejs --name my-project |
| 48 | +``` |
| 49 | + |
| 50 | +This example will generate scaffolding for a service with `Tencent` as a provider and `nodejs8` as runtime. The scaffolding |
| 51 | +will be generated in the current working directory. |
| 52 | + |
| 53 | +Your new service will have a default stage called `dev` and a default region inside that stage called `ap-guangzhou`. |
| 54 | +The provider which is used for deployment later on is Tencent Cloud. |
| 55 | + |
| 56 | +### Creating a named service in a (new) directory |
| 57 | + |
| 58 | +```bash |
| 59 | +serverless create --template tencent-nodejs --path tencent-project |
| 60 | +``` |
| 61 | + |
| 62 | +This example will generate scaffolding for a service with `Tencent` as a provider and `nodejs8` as runtime. The scaffolding |
| 63 | +will be generated in the `tencent-project` directory. This directory will be created if not present. Otherwise Serverless |
| 64 | +will use the already present directory. |
| 65 | + |
| 66 | +Additionally Serverless will rename the service according to the path you provide. In this example the service will be |
| 67 | +renamed to `tencent-project`. |
0 commit comments