Skip to content

Commit c3bdc63

Browse files
committed
Consistency in formatting file names
1 parent dd69ee4 commit c3bdc63

3 files changed

Lines changed: 20 additions & 20 deletions

File tree

tutorial/02-create-app.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Before moving on, install some additional packages that you will use later:
7272
> npm install --global --production windows-build-tools
7373
> ```
7474
75-
1. Update the application to use the `connect-flash` and `express-session` middleware. Open the `./app.js` file and add the following `require` statement to the top of the file.
75+
1. Update the application to use the `connect-flash` and `express-session` middleware. Open **./app.js** and add the following `require` statement to the top of the file.
7676
7777
```javascript
7878
const session = require('express-session');
@@ -88,21 +88,21 @@ Before moving on, install some additional packages that you will use later:
8888

8989
In this section you will implement the UI for the app.
9090

91-
1. Open the `./views/layout.hbs` file and replace the entire contents with the following code.
91+
1. Open **./views/layout.hbs** and replace the entire contents with the following code.
9292

9393
:::code language="html" source="../demo/graph-tutorial/views/layout.hbs" id="LayoutSnippet":::
9494

9595
This code adds [Bootstrap](http://getbootstrap.com/) for simple styling, and [Font Awesome](https://fontawesome.com/) for some simple icons. It also defines a global layout with a nav bar.
9696

97-
1. Open `./public/stylesheets/style.css` and replace its entire contents with the following.
97+
1. Open **./public/stylesheets/style.css** and replace its entire contents with the following.
9898

9999
:::code language="css" source="../demo/graph-tutorial/public/stylesheets/style.css":::
100100

101-
1. Open the `./views/index.hbs` file and replace its contents with the following.
101+
1. Open **./views/index.hbs** and replace its contents with the following.
102102

103103
:::code language="html" source="../demo/graph-tutorial/views/index.hbs" id="IndexSnippet":::
104104

105-
1. Open the `./routes/index.js` file and replace the existing code with the following.
105+
1. Open **./routes/index.js** and replace the existing code with the following.
106106

107107
:::code language="javascript" source="../demo/graph-tutorial/routes/index.js" id="IndexRouterSnippet" highlight="6-10":::
108108

tutorial/04-add-aad-auth.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,30 @@
22

33
In this exercise you will extend the application from the previous exercise to support authentication with Azure AD. This is required to obtain the necessary OAuth access token to call the Microsoft Graph. In this step you will integrate the [msal-node](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-node) library into the application.
44

5-
1. Create a new file named `.env` file in the root of your application, and add the following code.
5+
1. Create a new file named **.env** in the root of your application, and add the following code.
66

77
:::code language="ini" source="../demo/graph-tutorial/example.env":::
88

99
Replace `YOUR_APP_ID_HERE` with the application ID from the Application Registration Portal, and replace `YOUR_APP_SECRET_HERE` with the client secret you generated.
1010

1111
> [!IMPORTANT]
12-
> If you're using source control such as git, now would be a good time to exclude the `.env` file from source control to avoid inadvertently leaking your app ID and password.
12+
> If you're using source control such as git, now would be a good time to exclude the **.env** file from source control to avoid inadvertently leaking your app ID and password.
1313
14-
1. Open `./app.js` and add the following line to the top of the file to load the `.env` file.
14+
1. Open **./app.js** and add the following line to the top of the file to load the **.env** file.
1515

1616
```javascript
1717
require('dotenv').config();
1818
```
1919

2020
## Implement sign-in
2121

22-
1. Locate the line `var indexRouter = require('./routes/index');` in `./app.js`. Insert the following code **before** that line.
22+
1. Locate the line `var indexRouter = require('./routes/index');` in **./app.js**. Insert the following code **before** that line.
2323

2424
:::code language="javascript" source="../demo/graph-tutorial/app.js" id="MsalInitSnippet":::
2525

2626
This code initializes the msal-node library with the app ID and password for the app.
2727

28-
1. Create a new file in the `./routes` directory named `auth.js` and add the following code.
28+
1. Create a new file in the **./routes** directory named **auth.js** and add the following code.
2929

3030
```javascript
3131
var router = require('express-promise-router')();
@@ -116,11 +116,11 @@ In this exercise you will extend the application from the previous exercise to s
116116

117117
The `signin` route calls the `getAuthCodeUrl` function to generate the login URL, then redirects the browser to that URL.
118118

119-
The `callback` route is where Azure redirects after the signin is complete. The code calls the `acquireTokenByCode` function to exchange the authorization code for an access token. Once the token is obtained, it redirects back to the home page with the access token in the temporary error value. We'll use this to verify that our sign-in is working before moving on. Before we test, we need to configure the Express app to use the new router from `./routes/auth.js`.
119+
The `callback` route is where Azure redirects after the signin is complete. The code calls the `acquireTokenByCode` function to exchange the authorization code for an access token. Once the token is obtained, it redirects back to the home page with the access token in the temporary error value. We'll use this to verify that our sign-in is working before moving on. Before we test, we need to configure the Express app to use the new router from **./routes/auth.js**.
120120

121121
The `signout` method logs the user out and destroys the session.
122122

123-
1. Open `./app.js` and insert the following code **before** the `var app = express();` line.
123+
1. Open **./app.js** and insert the following code **before** the `var app = express();` line.
124124

125125
```javascript
126126
var authRouter = require('./routes/auth');
@@ -136,7 +136,7 @@ Start the server and browse to `https://localhost:3000`. Click the sign-in butto
136136

137137
### Get user details
138138

139-
1. Create a new file in the root of the project named `graph.js` and add the following code.
139+
1. Create a new file in the root of the project named **graph.js** and add the following code.
140140

141141
```javascript
142142
var graph = require('@microsoft/microsoft-graph-client');
@@ -170,7 +170,7 @@ Start the server and browse to `https://localhost:3000`. Click the sign-in butto
170170

171171
This exports the `getUserDetails` function, which uses the Microsoft Graph SDK to call the `/me` endpoint and return the result.
172172

173-
1. Open `/auth.js` and add the following `require` statements to the top of the file.
173+
1. Open **./routes/auth.js** and add the following `require` statements to the top of the file.
174174

175175
```javascript
176176
var graph = require('../graph');

tutorial/05-add-ms-graph.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ In this exercise you will incorporate Microsoft Graph into the application. For
44

55
## Get calendar events from Outlook
66

7-
1. Open `./graph.js` and add the following function inside `module.exports`.
7+
1. Open **./graph.js** and add the following function inside `module.exports`.
88

99
:::code language="javascript" source="../demo/graph-tutorial/graph.js" id="GetCalendarViewSnippet":::
1010

@@ -14,7 +14,7 @@ In this exercise you will incorporate Microsoft Graph into the application. For
1414
- The `select` method limits the fields returned for each events to just those the view will actually use.
1515
- The `orderby` method sorts the results by the date and time they were created, with the most recent item being first.
1616

17-
1. Create a new file in the `./routes` directory named `calendar.js`, and add the following code.
17+
1. Create a new file in the **./routes** directory named **calendar.js**, and add the following code.
1818

1919
```javascript
2020
const router = require('express-promise-router')();
@@ -102,7 +102,7 @@ In this exercise you will incorporate Microsoft Graph into the application. For
102102
module.exports = router;
103103
```
104104

105-
1. Update `./app.js` to use this new route. Add the following line **before** the `var app = express();` line.
105+
1. Update **./app.js** to use this new route. Add the following line **before** the `var app = express();` line.
106106

107107
```javascript
108108
var calendarRouter = require('./routes/calendar');
@@ -120,19 +120,19 @@ In this exercise you will incorporate Microsoft Graph into the application. For
120120
121121
Now you can add a view to display the results in a more user-friendly manner.
122122
123-
1. Add the following code in `./app.js` **after** the `app.set('view engine', 'hbs');` line.
123+
1. Add the following code in **./app.js after** the `app.set('view engine', 'hbs');` line.
124124
125125
:::code language="javascript" source="../demo/graph-tutorial/app.js" id="FormatDateSnippet":::
126126
127127
This implements a [Handlebars helper](http://handlebarsjs.com/#helpers) to format the ISO 8601 date returned by Microsoft Graph into something more human-friendly.
128128
129-
1. Create a new file in the `./views` directory named `calendar.hbs` and add the following code.
129+
1. Create a new file in the **./views** directory named **calendar.hbs** and add the following code.
130130
131131
:::code language="html" source="../demo/graph-tutorial/views/calendar.hbs" id="LayoutSnippet":::
132132
133133
That will loop through a collection of events and add a table row for each one.
134134
135-
1. Now update the route in `./routes/calendar.js` to use this view. Replace the existing route with the following code.
135+
1. Now update the route in **./routes/calendar.js** to use this view. Replace the existing route with the following code.
136136
137137
:::code language="javascript" source="../demo/graph-tutorial/routes/calendar.js" id="GetRouteSnippet" highlight="33-36,49,51-54,61":::
138138

0 commit comments

Comments
 (0)