使用 Microsoft Graph 生成 JavaScript 单页面应用

本教程向您介绍如何构建使用 Microsoft Graph API 检索用户的日历信息的 JavaScript 单页面应用。This tutorial teaches you how to build a JavaScript single-page app that uses the Microsoft Graph API to retrieve calendar information for a user.

提示

如果您只想下载已完成的教程,可以下载或克隆 GitHub 存储库If you prefer to just download the completed tutorial, you can download or clone the GitHub repository.

必备条件Prerequisites

在开始本教程之前,你将需要访问 HTTP 服务器以承载示例文件。Before you start this tutorial, you will need access to an HTTP server to host the sample files. 这可以是开发计算机上的测试服务器,也可以是远程服务器上的服务器。This could be a test server on your development machine, or a remote server. 本教程包含使用 Node.js 包在开发计算机上运行简单测试服务器的说明。The tutorial includes instructions to use a Node.js package to run a simple test server on your development machine. 如果您计划使用此选项,则您的开发计算机上应安装有 Node.jsIf you plan to use this option, you should have Node.js installed on your development machine. 如果您没有 Node.js,请访问 "下载选项" 的上一个链接。If you do not have Node.js, visit the previous link for download options.

您还应具有一个个人的 Microsoft 帐户,其中包含 Outlook.com 上的邮箱,或 Microsoft 工作或学校帐户。You should also have either a personal Microsoft account with a mailbox on Outlook.com, or a Microsoft work or school account. 如果你没有 Microsoft 帐户,可以使用以下几种方法获取免费帐户:If you don't have a Microsoft account, there are a couple of options to get a free account:

备注

本教程是使用节点版本12.16.1 编写的。This tutorial was written with Node version 12.16.1. 本指南中的步骤可能适用于其他版本,但尚未经过测试。The steps in this guide may work with other versions, but that has not been tested.

反馈Feedback

请在 GitHub 存储库中提供有关本教程的任何反馈。Please provide any feedback on this tutorial in the GitHub repository.