├── Completed ├── .gitignore ├── package.json ├── public │ ├── controllers │ │ └── homeController.js │ ├── index.html │ ├── scripts │ │ └── app.js │ └── views │ │ └── home.html └── server.js ├── LICENSE ├── README.md └── Starter ├── .gitignore ├── package.json ├── public ├── controllers │ └── homeController.js ├── index.html ├── scripts │ └── app.js └── views │ └── home.html └── server.js /Completed/.gitignore: -------------------------------------------------------------------------------- 1 | logs/* 2 | !.gitkeep 3 | node_modules/ 4 | tmp 5 | .DS_Store 6 | .idea -------------------------------------------------------------------------------- /Completed/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "O365-Angular-GettingStarted", 3 | "version": "1.0.1", 4 | "license": "MIT", 5 | "main": "server.js", 6 | "dependencies": { 7 | "express": "^4.12.3", 8 | "morgan": "^1.5.2", 9 | "path": "^0.11.14" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Completed/public/controllers/homeController.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. 3 | */ 4 | 5 | (function () { 6 | angular 7 | .module('app') 8 | .controller('HomeController', HomeController); 9 | 10 | /** 11 | * The HomeController code. 12 | */ 13 | function HomeController($http, $log) { 14 | var vm = this; 15 | 16 | /** 17 | * Pass in the resource URL that you're requesting. 18 | * 19 | * Note: ADAL JS does not validate the token received from Azure AD. It relies on the app’s 20 | * backend to do so, and until we call the backend, we don’t know if the user obtained an 21 | * acceptable token. Business applications should have a server-side component for user 22 | * authentication built into the web application for security reasons. Without this backend token 23 | * validation, your app is susceptible to security attacks such as the confused deputy problem. 24 | * Check out this blog post (http://www.cloudidentity.com/blog/2015/02/19/introducing-adal-js-v1/) 25 | * for more information. 26 | */ 27 | $http.get("https://outlook.office365.com/api/v1.0/me/messages") 28 | .then(function(response) { 29 | $log.debug('HTTP request to Mail API returned successfully.'); 30 | vm.emails = response.data.value; 31 | }, function(error) { 32 | $log.error('HTTP request to Mail API failed.'); 33 | }); 34 | }; 35 | })(); 36 | 37 | 38 | // ********************************************************* 39 | // 40 | // O365-Angular-GettingStarted, https://github.com/OfficeDev/O365-Angular-GettingStarted 41 | // 42 | // Copyright (c) Microsoft Corporation 43 | // All rights reserved. 44 | // 45 | // MIT License: 46 | // Permission is hereby granted, free of charge, to any person obtaining 47 | // a copy of this software and associated documentation files (the 48 | // "Software"), to deal in the Software without restriction, including 49 | // without limitation the rights to use, copy, modify, merge, publish, 50 | // distribute, sublicense, and/or sell copies of the Software, and to 51 | // permit persons to whom the Software is furnished to do so, subject to 52 | // the following conditions: 53 | // 54 | // The above copyright notice and this permission notice shall be 55 | // included in all copies or substantial portions of the Software. 56 | // 57 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 58 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 59 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 60 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 61 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 62 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 63 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 64 | // 65 | // ********************************************************* -------------------------------------------------------------------------------- /Completed/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Office 365 APIs sample 10 | 11 | 12 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 |
35 |
36 | 39 |
40 |
41 |
42 |
43 |
44 | 45 | 46 | 47 | 48 | 75 | -------------------------------------------------------------------------------- /Completed/public/scripts/app.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. 3 | */ 4 | 5 | (function () { 6 | angular.module('app', [ 7 | 'ngRoute', 8 | 'AdalAngular' 9 | ]) 10 | .config(config); 11 | 12 | // Configure the routes. 13 | function config($routeProvider, $httpProvider, adalAuthenticationServiceProvider) { 14 | $routeProvider 15 | .when('/', { 16 | templateUrl: 'views/home.html', 17 | controller: 'HomeController', 18 | controllerAs: 'home', 19 | requireADLogin: true 20 | }) 21 | 22 | .otherwise({ 23 | redirectTo: '/' 24 | }); 25 | 26 | // The endpoints here are resources for ADAL to get tokens for. 27 | var endpoints = { 28 | 'https://outlook.office365.com': 'https://outlook.office365.com' 29 | }; 30 | 31 | // Initialize the ADAL provider with your tenant name and clientID (found in the Azure Management Portal). 32 | adalAuthenticationServiceProvider.init( 33 | { 34 | tenant: '{your_subdomain}.onmicrosoft.com', 35 | clientId: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', 36 | endpoints: endpoints, 37 | cacheLocation: 'localStorage' 38 | }, 39 | $httpProvider 40 | ); 41 | }; 42 | })(); 43 | 44 | 45 | // ********************************************************* 46 | // 47 | // O365-Angular-GettingStarted, https://github.com/OfficeDev/O365-Angular-GettingStarted 48 | // 49 | // Copyright (c) Microsoft Corporation 50 | // All rights reserved. 51 | // 52 | // MIT License: 53 | // Permission is hereby granted, free of charge, to any person obtaining 54 | // a copy of this software and associated documentation files (the 55 | // "Software"), to deal in the Software without restriction, including 56 | // without limitation the rights to use, copy, modify, merge, publish, 57 | // distribute, sublicense, and/or sell copies of the Software, and to 58 | // permit persons to whom the Software is furnished to do so, subject to 59 | // the following conditions: 60 | // 61 | // The above copyright notice and this permission notice shall be 62 | // included in all copies or substantial portions of the Software. 63 | // 64 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 65 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 66 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 67 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 68 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 69 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 70 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 71 | // 72 | // ********************************************************* 73 | -------------------------------------------------------------------------------- /Completed/public/views/home.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |
FromSubjectBody PreviewWeb Link
{{email.Sender.EmailAddress.Name}} ({{email.Sender.EmailAddress.Address}}){{email.Subject}}{{email.BodyPreview}}View on OWA
Your inbox is empty.
28 |
29 |
30 |
31 | 32 | -------------------------------------------------------------------------------- /Completed/server.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. 3 | */ 4 | 5 | var express = require('express'); 6 | var app = express(); 7 | var morgan = require('morgan'); 8 | var path = require('path'); 9 | 10 | // Initialize variables. 11 | var port = process.env.PORT || 8080; 12 | 13 | // Configure morgan module to log all requests. 14 | app.use(morgan('dev')); 15 | 16 | // Set the front-end folder to serve public assets. 17 | app.use(express.static(__dirname + '/public')); 18 | 19 | // Set up our one route to the index.html file. 20 | app.get('*', function (req, res) { 21 | res.sendFile(path.join(__dirname + '/public/index.html')); 22 | }); 23 | 24 | // Start the server. 25 | app.listen(port); 26 | console.log('Listening on port ' + port + '...'); 27 | 28 | // ********************************************************* 29 | // 30 | // O365-Angular-GettingStarted, https://github.com/OfficeDev/O365-Angular-GettingStarted 31 | // 32 | // Copyright (c) Microsoft Corporation 33 | // All rights reserved. 34 | // 35 | // MIT License: 36 | // Permission is hereby granted, free of charge, to any person obtaining 37 | // a copy of this software and associated documentation files (the 38 | // "Software"), to deal in the Software without restriction, including 39 | // without limitation the rights to use, copy, modify, merge, publish, 40 | // distribute, sublicense, and/or sell copies of the Software, and to 41 | // permit persons to whom the Software is furnished to do so, subject to 42 | // the following conditions: 43 | // 44 | // The above copyright notice and this permission notice shall be 45 | // included in all copies or substantial portions of the Software. 46 | // 47 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 48 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 49 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 50 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 51 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 52 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 53 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 54 | // 55 | // ********************************************************* -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Office Developer 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # [ARCHIVED] Create an Angular app with Office 365 APIs 2 | 3 | **Note:** This repo is archived and no longer actively maintained. Security vulnerabilities may exist in the project, or its dependencies. If you plan to reuse or run any code from this repo, be sure to perform appropriate security checks on the code or dependencies first. Do not use this project as the starting point of a production Office Add-in. Always start your production code by using the Office/SharePoint development workload in Visual Studio, or the [Yeoman generator for Office Add-ins](https://github.com/OfficeDev/generator-office), and follow security best practices as you develop the add-in. 4 | 5 | This sample was built for [Create an Angular app with Office 365 APIs](http://aka.ms/get-started-with-js). You will complete the project in the *Starter* folder as you walk through the tutorial found on that page. You can find the completed project in the *Completed* folder of this repository. 6 | 7 | Check out [Create an Angular app with Office 365 APIs](http://aka.ms/get-started-with-js) for a complete walkthrough on creating an Angular web application with the Office 365 APIs. If you'd prefer to just run the completed project found in the *Completed* folder, read the rest of this README. 8 | 9 | 10 | ## Prerequisites 11 | 12 | This sample requires the following: 13 | * [Node.js](https://nodejs.org/). Node is required to run the sample on a development server and to install dependencies. 14 | * An Office 365 account. You can sign up for [an Office 365 Developer subscription](http://aka.ms/ro9c62) that includes the resources that you need to start building Office 365 apps. 15 | * A Microsoft Azure tenant to register your application. Azure Active Directory provides identity services that applications use for authentication and authorization. A trial subscription can be acquired here: [Microsoft Azure](http://aka.ms/jjm0q7). 16 | 17 | **Note** You will also need to ensure your Azure subscription is bound to your Office 365 tenant. Check out the Active Directory team's blog post, [Creating and Managing Multiple Windows Azure Active Directories](http://aka.ms/lrb3ln) for instructions. In this post, the *Adding a new directory* section will explain how to do this. You can also read [Associate your Office 365 account with Azure AD to create and manage apps](http://aka.ms/fv273q) for more information. 18 | 19 | 20 | ## Register and configure the app 21 | 22 | 1. Sign into the [Azure Management Portal](https://manage.windowsazure.com/) using your Office 365 business account credentials. 23 | 24 | 2. Click the **Active Directory** node in the left column and select the directory linked to your Office 365 subscription. 25 | 26 | 3. Select the **Applications** tab and then **Add** at the bottom of the screen. 27 | 28 | 4. On the pop-up, select **Add an application my organization is developing**. Then click the arrow to continue. 29 | 30 | 5. Choose a name for the app, such as *SimpleMailApp*, and select **Web application and/or web API** as its Type. Then click the arrow to continue. 31 | 32 | 6. The value of **Sign-on URL** is the URL where the application will be hosted. Use *http://127.0.0.1:8080/* for the sample project. 33 | 34 | 7. The value of **App ID URI** is a unique identifier for Azure AD to identify the app. You can use http://{your_subdomain}/SimpleMailApp, where {your_subdomain} is the subdomain of .onmicrosoft you specified while signing up for your Office 365 business account. Then click the check mark to provision the application. 35 | 36 | 8. Once the application has been successfully added, you will be taken to the Quick Start page for the application. From here, select the **Configure** tab. 37 | 38 | 9. Scroll down to the **permissions to other applications** section and click the **Add application** button. 39 | 40 | 10. In this tutorial, we'll demonstrate how to get a user's email so add the **Office 365 Exchange Online** application. Click the plus sign in the application's row and then click the check mark at the top right to add it. Then click the check mark at the bottom right to continue. 41 | 42 | 11. In the **Office 365 Exchange Online** row, select **Delegated Permissions**, and in the selection list, choose **Read user mail**. 43 | 44 | 12. Click **Save** to save the app's configuration. 45 | 46 | ### Configure the app to allow the OAuth 2.0 implicit grant flow 47 | 48 | In order to get an access token for Office 365 API requests, the application will use the OAuth implicit grant flow. You need to update the application's manifest to allow the OAuth implicit grant flow because it is not allowed by default. 49 | 50 | 1. Select the **Configure** tab of the application's entry in the Azure Management Portal. 51 | 52 | 2. Using the **Manage Manifest** button in the drawer, download the manifest file for the application and save it to the computer. 53 | 54 | 3. Open the manifest file with a text editor. Search for the *oauth2AllowImplicitFlow* property. By default it is set to *false*; change it to *true* and save the file. 55 | 56 | 4. Using the **Manage Manifest** button, upload the updated manifest file. 57 | 58 | **Note** ADAL JS does not validate the token received from Azure AD. It relies on the app’s backend to do so, and until we call the backend, we don’t know if the user obtained an acceptable token. Business applications should have a server-side component for user authentication built into the web application for security reasons. Without this backend token validation, your app is susceptible to security attacks such as the [confused deputy problem](https://en.wikipedia.org/wiki/Confused_deputy_problem). Check out this [blog post](http://www.cloudidentity.com/blog/2015/02/19/introducing-adal-js-v1/) for more information. 59 | 60 | 61 | ## Run the app 62 | 63 | Open **app.js** in *Completed/public/scripts* and replace *{your_subdomain}* with the subdomain of .onmicrosoft you specified for your Office 365 tenant and the client ID of your registered Azure application on lines 34 and 35, respectively. 64 | 65 | Next, install the necessary dependencies and run the project via the command line. Begin by opening a command prompt and navigating to the *Completed* folder. Once there, follow the steps below. 66 | 67 | 1. Install project dependencies by running ```npm install```. 68 | 2. Now that all the project dependencies have been installed, start the development server by running ```node server.js``` in the *Completed* folder. 69 | 3. Navigate to ```http://127.0.0.1:8080/``` in your web browser. 70 | 71 | 72 | ## Questions and comments 73 | 74 | - If you have any trouble running this sample, please [log an issue](https://github.com/OfficeDev/O365-Angular-GettingStarted/issues). 75 | - For general questions about the Office 365 APIs, post to [Stack Overflow](http://stackoverflow.com/). Make sure that your questions or comments are tagged with [office365]. 76 | 77 | 78 | ## Additional resources 79 | 80 | * [Create an Angular app with Office 365 APIs](http://aka.ms/get-started-with-js) 81 | * [Office 365 APIs documentation](http://msdn.microsoft.com/office/office365/howto/platform-development-overview) 82 | * [Office Dev Center](http://dev.office.com/) 83 | 84 | ## Copyright 85 | Copyright (c) 2015 Microsoft. All rights reserved. 86 | 87 | 88 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information, see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. 89 | -------------------------------------------------------------------------------- /Starter/.gitignore: -------------------------------------------------------------------------------- 1 | logs/* 2 | !.gitkeep 3 | node_modules/ 4 | tmp 5 | .DS_Store 6 | .idea -------------------------------------------------------------------------------- /Starter/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "O365-Angular-GettingStarted", 3 | "version": "1.0.1", 4 | "license": "MIT", 5 | "main": "server.js", 6 | "dependencies": { 7 | "express": "^4.12.3", 8 | "morgan": "^1.5.2", 9 | "path": "^0.11.14" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Starter/public/controllers/homeController.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. 3 | */ 4 | 5 | (function () { 6 | angular 7 | .module('app') 8 | .controller('HomeController', HomeController); 9 | 10 | /** 11 | * The HomeController code. 12 | */ 13 | function HomeController($http, $log) { 14 | var vm = this; 15 | }; 16 | })(); 17 | 18 | 19 | // ********************************************************* 20 | // 21 | // O365-Angular-GettingStarted, https://github.com/OfficeDev/O365-Angular-GettingStarted 22 | // 23 | // Copyright (c) Microsoft Corporation 24 | // All rights reserved. 25 | // 26 | // MIT License: 27 | // Permission is hereby granted, free of charge, to any person obtaining 28 | // a copy of this software and associated documentation files (the 29 | // "Software"), to deal in the Software without restriction, including 30 | // without limitation the rights to use, copy, modify, merge, publish, 31 | // distribute, sublicense, and/or sell copies of the Software, and to 32 | // permit persons to whom the Software is furnished to do so, subject to 33 | // the following conditions: 34 | // 35 | // The above copyright notice and this permission notice shall be 36 | // included in all copies or substantial portions of the Software. 37 | // 38 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 39 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 40 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 41 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 42 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 43 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 44 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 45 | // 46 | // ********************************************************* -------------------------------------------------------------------------------- /Starter/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Office 365 APIs sample 10 | 11 | 12 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
32 | 35 |
36 |
37 |
38 |
39 |
40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /Starter/public/scripts/app.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. 3 | */ 4 | 5 | (function () { 6 | angular.module('app', [ 7 | 'ngRoute' 8 | ]) 9 | .config(config); 10 | 11 | // Configure the routes. 12 | function config($routeProvider) { 13 | $routeProvider 14 | .when('/', { 15 | templateUrl: 'views/home.html', 16 | controller: 'HomeController', 17 | controllerAs: 'home' 18 | }) 19 | 20 | .otherwise({ 21 | redirectTo: '/' 22 | }); 23 | }; 24 | })(); 25 | 26 | 27 | // ********************************************************* 28 | // 29 | // O365-Angular-GettingStarted, https://github.com/OfficeDev/O365-Angular-GettingStarted 30 | // 31 | // Copyright (c) Microsoft Corporation 32 | // All rights reserved. 33 | // 34 | // MIT License: 35 | // Permission is hereby granted, free of charge, to any person obtaining 36 | // a copy of this software and associated documentation files (the 37 | // "Software"), to deal in the Software without restriction, including 38 | // without limitation the rights to use, copy, modify, merge, publish, 39 | // distribute, sublicense, and/or sell copies of the Software, and to 40 | // permit persons to whom the Software is furnished to do so, subject to 41 | // the following conditions: 42 | // 43 | // The above copyright notice and this permission notice shall be 44 | // included in all copies or substantial portions of the Software. 45 | // 46 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 47 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 48 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 49 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 50 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 51 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 52 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 53 | // 54 | // ********************************************************* 55 | -------------------------------------------------------------------------------- /Starter/public/views/home.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OfficeDev/O365-Angular-GettingStarted/2228a5dd21691566c3fcd19ece48c50ea0c3ab93/Starter/public/views/home.html -------------------------------------------------------------------------------- /Starter/server.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. 3 | */ 4 | 5 | var express = require('express'); 6 | var app = express(); 7 | var morgan = require('morgan'); 8 | var path = require('path'); 9 | 10 | // Initialize variables. 11 | var port = process.env.PORT || 8080; 12 | 13 | // Configure morgan module to log all requests. 14 | app.use(morgan('dev')); 15 | 16 | // Set the front-end folder to serve public assets. 17 | app.use(express.static(__dirname + '/public')); 18 | 19 | // Set up our one route to the index.html file. 20 | app.get('*', function (req, res) { 21 | res.sendFile(path.join(__dirname + '/public/index.html')); 22 | }); 23 | 24 | // Start the server. 25 | app.listen(port); 26 | console.log('Listening on port ' + port + '...'); 27 | 28 | // ********************************************************* 29 | // 30 | // O365-Angular-GettingStarted, https://github.com/OfficeDev/O365-Angular-GettingStarted 31 | // 32 | // Copyright (c) Microsoft Corporation 33 | // All rights reserved. 34 | // 35 | // MIT License: 36 | // Permission is hereby granted, free of charge, to any person obtaining 37 | // a copy of this software and associated documentation files (the 38 | // "Software"), to deal in the Software without restriction, including 39 | // without limitation the rights to use, copy, modify, merge, publish, 40 | // distribute, sublicense, and/or sell copies of the Software, and to 41 | // permit persons to whom the Software is furnished to do so, subject to 42 | // the following conditions: 43 | // 44 | // The above copyright notice and this permission notice shall be 45 | // included in all copies or substantial portions of the Software. 46 | // 47 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 48 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 49 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 50 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 51 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 52 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 53 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 54 | // 55 | // ********************************************************* --------------------------------------------------------------------------------