项目作者: ketangit

项目描述 :
Sample Typescript Nodejs Server application using TypeGraphQL, TypeORM and Node-OracleDB
高级语言: TSQL
项目地址: git://github.com/ketangit/sample-graphql-server.git
创建时间: 2018-08-06T03:10:10Z
项目社区:https://github.com/ketangit/sample-graphql-server

开源协议:

下载


Sample Typescript Nodejs Server application using TypeGraphQL, TypeORM and Node-OracleDB

Steps to create base TypeScript project

  1. 1. Create a folder
  2. mkdir sample-graphql-server
  3. cd sample-graphql-server
  4. npm init -> creates package.json
  5. 2. Install node modules
  6. npm install -D typescript (-D flag is the shortcut for: --save-dev)
  7. npm install -D tslint
  8. npm install -D ts-node nodemon (Create 'nodemon.json' file)
  9. npm install -D @types/node-fetch
  10. npm install -D typescript-tslint-plugin
  11. npm install -D typescript
  12. npm install -D rimraf
  13. npm install dotenv
  14. 3. Run the following command to generate a 'tsconfig.json' file
  15. npx tsc --init --rootDir src --outDir dist --esModuleInterop --resolveJsonModule \
  16. --lib es6 --module commonjs --allowJs true --noImplicitAny true
  17. 4. Run the following command to generate a 'tslint.json' file
  18. .\node_modules\.bin\tslint --init
  19. 5. Create 'index.ts' file which is the start of the server
  20. mkdir src
  21. cd src
  22. index.ts

Steps to add TypeGraphQL and TypeORM dependecies

  1. npm install graphql
  2. npm install apollo-server
  3. npm install -D type-graphql
  4. npm install reflect-metadata
  5. npm install typeorm
  6. npm install oracledb (Oracle Database driver)
  7. npm install typedi (Dpendency injection tool for TypeScript)
  8. npm install typeorm-typedi-extensions (TypeDI Service container integration with TypeORM)

Steps to run this project locally:

  1. Run npm install command to install dependencies
  2. Run npm run build command to build application
  3. Run npm run start-dev command to run application locally
  4. Open http://localhost:3000

Credit / Prior Art