当前位置: 首页 > 软件库 > Web应用开发 > >

rest-api-node-typescript

授权协议 Readme
开发语言 JavaScript
所属分类 Web应用开发
软件类型 开源软件
地区 不详
投 递 者 汪鸿志
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Building RESTful Web APIs with Node.js, Express, MongoDB and TypeScript

This is a simple API that saves contact information of people.

There are two versions of this project.

  • V1.0.0: you can run the server directly after cloning this version. It will create a simple RESTful API over HTTP.
  • V2.0.0: this is a more secure and control API project. You need to read the post on how to secure RESTful API application first. After that, you can run the project.

Requirements

NodeJS

Install global TypeScript and TypeScript Node

npm install -g typescript ts-node

Getting Started

You should install MongoDB on your local machine, or use other services such as mLab or Compose

After that, you will have to replace the mongoURL with your MongoDB address in lib/app.ts

Clone this repository

git clone git@github.com:dalenguyen/rest-api-node-typescript.git .

Then install the dependencies

npm install

Start the server

Run in development mode

npm run dev

Run in production mode

npm run prod

Testing over HTTP (tag v1.0.0)

The default URL is: http://localhost:3000

  • GET all contacts
Send GET request to http://localhost:3000/contact/

Testing over HTTPs (tag v2.0.0)

The default URL is: https://localhost:3000

The key and cert in the config folder is for testing purpose only. You should generate your own.

Reference from Lynda.com

 相关资料
  • RESTful API using Node.js, Express, Mongoose & TypeScript This is a boilerplate for building scalable and robust REST APIs using Node.js & TypeScript. Table of Contents Prerequisites Features Getting

  • Node - Koa - Typescript Project The main purpose of this repository is to build a good project setup and workflow for writing a Node api rest in TypeScript using KOA and an SQL DB. Koa is a new web fr

  • Node.js API com Typescript Código do curso �� DO ZERO A PRODUÇÃO: APRENDA A CONSTRUIR UMA API NODE.JS COM TYPESCRIPT Durante o curso é criado uma API para calcular a melhor condição de surf entre vari

  • 由于现有的node weixin api接口做的比较麻烦,不利于书写与理解.故重新书写代码,架构. 让开发者更容易理解与使用,并且帮助提升软件质量 node-weixin-api是基于node-weixin-*的API接口的SDK。 它们都是由下列子项目组合而成, node-weixin-api只是将业务接口统一到一个api里方便调用,而不必一个一个重新安装: node-weixin-config

  • 我尝试了很多次,但得到以下错误 http://localhost:3001/getlocaiton net::err_connection_delection和createError(createError.js:17)位于xmlHttpRequest.handleerror(xhr.js:87)。

  • Storm UI 守护程序提供了一个 REST API, 允许您与 Storm 集群进行交互, 其中包括检索 metrics(度量)数据和配置信息, 启动或停止 topologies(拓扑)的管理操作。 数据格式 该 REST API 返回 JSON 响应并支持 JSONP. 客户端可以传回一个回调查询参数, 以在回调函数中包装 JSON。 REST API allows CORS by defa