-
Notifications
You must be signed in to change notification settings - Fork 577
Directory structure
Dependency Injection And directory structure. , so you can Place your code at will , but we still Several common directory structures are recommended. .
In this structure, all files can be placed in the src Directory. In quick start projects or small-volume code, we often use this structure, our scaffolding also uses this method.
The following is the simplest structure of a function. The core includes f.yml Standardize the function information configuration file and the project structure of TypeScript.
.
โโโ f.yml # standard specification file
โโโ package.json # project dependencies
โโโ src
โ โโโ index.ts # function entry
โโโ tsconfig.json
As the amount of code increases, subdirectories are required to standardize our code. For functions, function portals and dependent services are common, so the following directory structure is available.
.
โโโ f.yml # standard specification file
โโโ package.json # project dependencies
โโโ src
โ โโโ function # function entry
โ โ โโโ index.ts
โ โโโ service # DI services directory
โ โโโ userService.ts
โโโ tsconfig.json
This directory can maintain relatively good isolation and scalability as the amount of code increases.