后端-基础搭建
1、🍉 项目基础目录结构组织
1-1、初始化
创建项目目录 backend
,并通过 npm init
进行初始化。
1-2、ts 配置
根目录创建 ts 配置文件:tsconfig.json
,配置如下:
// file: backend/tsconfig.json
{
"compilerOptions": {
"allowJs": true,//允许编译javascript文件
"outDir": "./dist", //最后的文件存放目录
"module": "commonjs", //设置编译后的模块
"target": "es2016", //编译目标
"sourceMap": true,
"noImplicitAny": true, //隐式类型【不要any类型】
"strictNullChecks": true, //严格的控制检查
"experimentalDecorators": true, //装饰器
"emitDecoratorMetadata": true, //给源码里的装饰器声明加上设计类型元数据