

tsconfig.json )įrom now, although you can not send a HTTP request yet, you still can test the project by running npm run dev. And of course, we will take advantage of the ES2015 in the project. The idea is to put all the TypeScript files in the lib folder for development purpose, then for the production, we will save all the Javascript files in the dist folder. Step 3: Configure the TypeScript configuration file Step 2: Install all the dependencies npm install -save express body-parser mongoose nodemon The project structure has currently no support for the client-side code you wish to run in the browser. Remember to answer all the question, and you can edit it any time after that mkdir node-apis-project cd node-apis-project npm init That is, all express-js code and utilities, etc. Otherwise, you just need to follow the steps in order to get your project run.Ĭreate a project folder and initiate the npm project. If you installed MongoDB locally, you should install either Robo Mongo or Mongo Compass for GUI interface.īefore we dive into the coding part, you can checkout my github repository if you want to read the configuration in advance. You should install MongoDB on your local machine, or use other services such as mLab or Compose In order to test HTTP request, we can use Postman to send sample requests. After that, you have to install TypeScript and TypeScript Node. Make sure that you have NodeJS installed on your machine. Part 4: Connect Web APIs to MongoDB or othersīonus: Building a “Serverless” RESTful API with Cloud Functions, Firestore and Expressīonus: Handling Long Running API Requests in Nodejs Part 3: Using Controller and Model for Web APIs There are lots of things that need to improve in this project. So I decided to make one with TypeScript. There is a course about how to build a Web APIs on Lynda, but they didn’t use TypeScript.
