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

api-design-node-v3

[Course] API design in Node with Express v3
授权协议 Readme
开发语言 JavaScript
所属分类 Web应用开发
软件类型 开源软件
地区 不详
投 递 者 万俟靖
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Course Code for API design in Node.js with Express, v3

Scott Moss & Frontend Masters

Resources

Course

This course has two parts, slides and excercises. The slides describe the excerices in detail. Each excercise has a starting branch and solution branch. Example lesson-1 and lesson-1-solution.

Exercises

Hello world Express

  • branch - lesson-1

In this lesson you'll be creating a simple Express based API in node, just to get your feet wet.

  • install dependencies with yarn (prefered for version locking) or npm
  • create a route that sends back some json
  • create a route that accepts json and logs it
  • start the server

Routing

  • branch - lesson-2
  • test command - yarn test-routes or npm run test-routes

This exercise will have you creating routes and sub routers for our soon the be DB resources using Express routing and routers

  • create a router for the Item resource
  • create full crud routes and create placeholder controllers
  • mount router on the root server
  • ensure all tests pass by running test command

Create Schemas

  • branch - lesson-3
  • test command - yarn test-models or npm run test-models

In this exercise, you'll be taking what you learned about Mongoose and MongoDb to create a schema and model for the Item resource.

  • create a schema for the item resource
  • add the correct fields (look at test)
  • add the correct validations (look at test)
  • extra add compund index to ensure all tasks in a list have unique names
  • ensure all tests pass by running test command

Controllers

  • branch - lesson-4
  • test command - yarn test-controllers or npm run test-controllers

So far we have routes and models. Now we need to hook our routes up to our models so we can perfom CRUD on the models based on the routes + verbs. That's exactly what controllers do.

  • create CRUD resolvers in utils/crud.js
  • create controllers for the Item resources using the base crud resolvers
  • ensure all tests pass by running test command

Authentication

  • branch - lesson-5
  • test command - yarn test-auth or npm run test-auth

In this exercise you'll be locking down our API using JWT's.

  • create a signup controller
  • create a signin controller
  • create a protect middlware to lock down API routes
  • ensure all tests pass by running test command

Testing

THe other resources don't have any test, go ahead and write some!

  • vite脚手架创建项目 1、全局安装vite脚手架 npm install -g create-vite-app 2、使用脚手架创建项目 create-vite-app projectName 3、进入项目文件夹 cd projectName 4、安装依赖 npm install 5、启动vue3.0项目 npm run dev 升级Vue-cli npm update -g @vue/cli #

  • api 开发思路 在 models 文件夹管理 mongoose Schema 和 Model 在 controllers 文件夹管理 mongoose 操作 在 routes 文件夹管理 api 在 app.js 配置 api,基础路径是 /api api-用户管理-用户注册 api 设计 基本信息 Path: /signup Method: POST 请求参数 Body 参数名称 是否必传 类

  • White House Web API Standards Guidelines Pragmatic REST RESTful URLs HTTP Verbs Responses Error handling Versions Record limits Request & Response Examples Mock Responses JSONP Guidelines【指导原则】 This d

  • 2021SC@SDUSC AutoComplete自动完成 用法: • 需要一个输入框而不是选择器。 • 需要输入建议/辅助提示。 和 Select 的区别是: • AutoComplete 是一个带提示的文本输入框,用户可以自由输入,关键词是辅助输入。 Select 是在限定的可选项中进行选择,关键词是选择。 API 参数 说明 类型 默认值 版本 allowClear 支持清除 boolean

  • To answer the first question about using a bundled version of OpenSSL: node generates static objects during compile based on the needs of the crypto api. For example the crypto API requires the follow

 相关资料
  • The Object Design APIs are a group of APIs used to control the object (show or hide). Together with the documentation, we provide live demos for you to understand each API. Click the link below to see

  • restful-api-design-references是RESTful API 设计参考文献列表,可帮助你更加彻底的了解REST风格的接口设计。 RESTful 介绍及设计思路 Principles of good RESTful API Design(译:好 RESTful API 的设计原则 )简单易懂,条理清晰,推荐 Best Practices for Designing a Prag

  • 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

  • 使用YouTubeBaseActivity、YouTubePlayerView和YouTubePlayer启动并运行示例活动非常简单。但是,我在定向方面遇到了麻烦,找不到任何文档或示例代码。当我在播放视频时切换时,屏幕是空白的。 在onCreate()、onPause()、onSaveInstanceState()和onRestoreInstanceState()中要继续播放视频,正确的操作是什么

  • 我正在使用YouTube数据API (Java)将视频上传到我的YouTube频道。我已经在我的Windows PC上测试过了,并且成功了。但是示例中的授权通过打开浏览器窗口登录Google来创建凭证实例。这在我的Windows PC上没问题,但是我试图让这段代码在我只能通过SSH访问的远程linux机器上运行。 我在stackoverflow中搜索了类似的问题,发现了完全相同的问题。但由于这个问