If you prefer to configure a web server and host the add-in's web files from your computer, use the following steps.
-
Install a recent version of npm and Node.js on your computer. To verify if you've already installed these tools, run the commands
node -v
andnpm -v
in your terminal. -
You need http-server to run the local web server. If you haven't installed this yet you can do this with the following command:
npm install --global http-server
-
You need Office-Addin-dev-certs to generate self-signed certificates to run the local web server. If you haven't installed this yet you can do this with the following command:
npm install --global office-addin-dev-certs
-
Clone or download this sample to a folder on your computer. Then, go to that folder in a console or terminal window.
-
Run the following command to generate a self-signed certificate to use for the web server.
npx office-addin-dev-certs install
This command will display the folder location where it generated the certificate files.
-
Go to the folder location where the certificate files were generated. Copy the localhost.crt and localhost.key files to the cloned or downloaded sample folder.
-
Run the following command.
http-server -S -C localhost.crt -K localhost.key --cors . -p 3000
The http-server will run and host the current folder's files on
localhost:3000
. -
Now that your localhost web server is running, you can sideload the manifest.xml file. Using the manifest.xml file, follow the steps in Sideload Outlook add-in on Windows or Mac to sideload and run the add-in.