/battlesnake-azure-function

A Battlesnake Azure Function Starter Project

Primary LanguageTypeScript

A Simple Battlesnake written in TypeScript for Azure Functions

Build CI

This is a basic implimentation of the Battlesnake API based on the official Node.js starter project.

Technologies

  • TypeScript
  • Azure Functions
  • localtunnel (for testing and/or running locally)

Prerequisite

Tooling

Running your Battlesnake

Running Locally

Make sure you install the project dependencies if you haven't yet.

npm install

Execute the start script:

npm run start

GET/POST the snake API:

end:    [POST]  http://localhost:7071/api/snake/end
index:  [GET]   http://localhost:7071/api/snake
move:   [POST]  http://localhost:7071/api/snake/move
start:  [POST]  http://localhost:7071/api/snake/start

Create a tunnel to try it out

So, with localtunnel (or ngrok if you'd prefer) you can setup a tunnel to enable you to add your locally running Battlesnake to Battlesnake online.

Execute the tunnel script

npm run tunnel

Once running you'll be given a url. For example:

your url is: https://spotty-fox-64.loca.lt

You can now register your local Battlesnake online by replacing you local address http://localhost:7071 with the url provided by localtunnel. For example:

https://spotty-fox-64.loca.lt/api/snake

Running In Azure

TODO