A devcontainer template adaptated from the official Battlesnake starter template written in Typescript, including the installation of the Battlesnake CLI and setup to test performance locally.
This project uses TypeScript, Node.js, and Express. It also comes with an optional Dockerfile to help with deployment.
Start your Battlesnake
npm run start
You should see the following output once it is running
Running Battlesnake at http://0.0.0.0:8000
Open localhost:8000 in your browser and you should see
{"apiversion":"1","author":"","color":"#888888","head":"default","tail":"default"}
Install the Battlesnake CLI
- You can download compiled binaries here
- or install as a go package (requires Go 1.18 or higher)
Command to run a local game
battlesnake play -W 11 -H 11 --name 'TypeScript Starter Project' --url http://localhost:8000 -g solo --browser
Command to execute the performance test locally:
npm run battlesnake
Continue with the Battlesnake Quickstart Guide to customize and improve your Battlesnake's behavior.
Note: To play games on play.battlesnake.com you'll need to deploy your Battlesnake to a live web server OR use a port forwarding tool like ngrok to access your server locally.