Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
661 changes: 655 additions & 6 deletions README.md

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions p2p-vue-demo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/node_modules
/tests/node_modules
43 changes: 43 additions & 0 deletions p2p-vue-demo/api/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
bin
obj
csx
.vs
edge
Publish

*.user
*.suo
*.cscfg
*.Cache
project.lock.json

/packages
/TestResults

/tools/NuGet.exe
/App_Data
/secrets
/data
.secrets
appsettings.json
local.settings.json

node_modules
dist

# Local python packages
.python_packages/

# Python Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
5 changes: 5 additions & 0 deletions p2p-vue-demo/api/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"ms-azuretools.vscode-azurefunctions"
]
}
12 changes: 12 additions & 0 deletions p2p-vue-demo/api/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Node Functions",
"type": "node",
"request": "attach",
"port": 9229,
"preLaunchTask": "func: host start"
}
]
}
7 changes: 7 additions & 0 deletions p2p-vue-demo/api/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"azureFunctions.deploySubpath": ".",
"azureFunctions.postDeployTask": "npm install",
"azureFunctions.projectLanguage": "JavaScript",
"azureFunctions.projectRuntime": "~2",
"azureFunctions.preDeployTask": "npm prune"
}
23 changes: 23 additions & 0 deletions p2p-vue-demo/api/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "func",
"command": "host start",
"problemMatcher": "$func-watch",
"isBackground": true,
"dependsOn": "npm install"
},
{
"type": "shell",
"label": "npm install",
"command": "npm install"
},
{
"type": "shell",
"label": "npm prune",
"command": "npm prune --production",
"problemMatcher": []
}
]
}
6 changes: 6 additions & 0 deletions p2p-vue-demo/api/createTokenRequest/function.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"bindings": [
{ "authLevel": "function", "type": "httpTrigger", "direction": "in", "name": "req", "methods": [ "get" ] },
{ "type": "http", "direction": "out", "name": "res" }
]
}
10 changes: 10 additions & 0 deletions p2p-vue-demo/api/createTokenRequest/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const Ably = require('ably/promises');

module.exports = async function (context, req) {
const client = new Ably.Realtime(process.env.ABLY_API_KEY);
const tokenRequestData = await client.auth.createTokenRequest({ clientId: 'ably-azure-static-site-demo' });
context.res = {
headers: { "content-type": "application/json" },
body: JSON.stringify(tokenRequestData)
};
};
7 changes: 7 additions & 0 deletions p2p-vue-demo/api/host.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"version": "2.0",
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[1.*, 2.0.0)"
}
}
Loading