Build rest Api with typescript, expressJS, xata & RapidAPI
Actually you can do with two ways :
clone this repo
create manually by your self
To Clone this repo is very straight forward, just simply typing git clone https://github.com/ivandi1980/typescript-restapi.git
into your local machine
To Create manually, just simply :
- create folder (
mkdir <folder_name>
) - run :
npm init -y
- run :
npm i typescript --save-dev
- run :
npm i @types/node @types/express --save-dev
- run :
tsc --init
- run :
npm i --save-dev ts-node nodemon
- run :
npm i dotenv
- create file :
nodemon.json
- install/run :
npm i --save-dev rimraf
{
"compilerOptions": {
"sourceMap": true,
"outDir": "dist",
"rootDir": "src/",
"allowSyntheticDefaultImports": true,
"strict": true,
"target": "es6",
"lib": [
"esnext"
],
"moduleResolution": "Node",
"esModuleInterop": true,
"module": "CommonJS",
}
}
{
"watch": [
"src"
],
"ext": "ts, .js",
"ignore": [],
"exec": "ts-node ./src/index.ts"
}
compile run : npx tsc
development run : npm run start:dev