https://github.com/deadlyfingers/ARStudioAzureFunctions
Azure Functions for AR Studio game
https://github.com/deadlyfingers/ARStudioAzureFunctions
2player arstudio azure-functions cosmos-db mongodb mongoose nodejs turn-based
Last synced: about 2 months ago
JSON representation
Azure Functions for AR Studio game
- Host: GitHub
- URL: https://github.com/deadlyfingers/ARStudioAzureFunctions
- Owner: deadlyfingers
- License: mit
- Created: 2018-07-20T14:46:15.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-09T09:35:25.000Z (over 6 years ago)
- Last Synced: 2024-12-06T21:17:28.354Z (5 months ago)
- Topics: 2player, arstudio, azure-functions, cosmos-db, mongodb, mongoose, nodejs, turn-based
- Language: JavaScript
- Homepage: https://github.com/deadlyfingers/ARStudioGame
- Size: 74.2 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AR Studio game backend with Azure Functions [](https://travis-ci.org/deadlyfingers/ARStudioAzureFunctions)
Note: [AR Studio](https://developers.facebook.com/products/ar-studio) requires a Mac so we everything here is written for Mac user, but everything should run ok on Windows once available.
## Prerequistes for testing and running localhost on Mac
- [Node 8.5.0 or better](https://nodejs.org/en/)
- [Azure Functions core tools for Mac](https://docs.microsoft.com/en-us/azure/azure-functions/functions-run-local#brew)
- [MongoDB for running local db on Mac](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/#install-mongodb-community-edition)
- [ngrok for serving localhost as https (required for AR Studio)](https://ngrok.com/download)## Test on device using localhost
1. Start mongodb
`mongod`
2. Start Azure Functions locally
`func host start --debug VSCode`
3. Start ngrok https server
`ngrok http 7071`
4. Clone the [AR Studio game project](https://github.com/deadlyfingers/ARStudioGame) and add your *ngrok domain* to whitelisted domains. (Refer to the [readme](https://github.com/deadlyfingers/ARStudioGame/blob/master/README.md) for config instuctions.)## API
The API is available as [Postman collection](https://raw.githubusercontent.com/deadlyfingers/ARStudioAzureFunctions/master/postman_collection.json) which can be imported into [Postman app](https://www.getpostman.com/).
- LobbyCreate
- LobbyJoin
- LobbyDelete
- MatchReady
- MatchStatus
- MatchTurn
- MatchDelete## Testing
`npm test`## Deployment
1. Fork this repo
2. Sign in to [Azure portal](https://portal.azure.com)
2. Create new **Azure Function**
3. Once your **Azure Function** is provisioned then update your **Function app settings** to use **version 2 (beta)**

4. Create new **Azure Cosmos DB** and select MongoDB from the API options. Once it's provisioned then select '**Connection String**' under **Settings** and copy your connection details including *HOST*, *PORT*, *USERNAME*, *PRIMARY PASSWORD*
5. Back in your **Azure Function** add the following environment variables using your connection details:
- **MongoDBHost**
- **MongoDBPort**
- **MongoDBUser**
- **MongoDBPass**
6. To deploy your Function app select
**Platform Features > Deployment Options > Setup > GitHub**
and choose your forked repo.