Skip to content
A mostly complete snake intended for Battlesnake 2018
TypeScript JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore
Procfile
README.md
app.json
package-lock.json
package.json
tsconfig.json
webpack.config.js

README.md

battlesnake-node-typescript

A simple BattleSnake AI written in TypeScript for NodeJS.

To get started you'll need a working NodeJS development environment, and at least read the Heroku docs on deploying a NodeJS app.

If you haven't setup a NodeJS development environment before, read how to get started with NodeJS. You'll also need npm for easy JS dependency management.

This client uses Express4 for easy route management, read up on the docs to learn more about reading incoming JSON params, writing responses, etc.

Deploy

Running the AI locally

Fork and clone this repo:

git clone git@github.com:giftbit/battlesnake-node-typescript.git
cd battlesnake-node-typescript

Install the client dependencies:

npm install

Compile the Typescript

npm run build

Create an .env file in the root of the project and add your environment variables (optional).

Run the server:

nf start web

Test the client in your browser: http://localhost:5000

Deploying to Heroku

Click the Deploy to Heroku button at the top or use the command line commands below.

Create a new NodeJS Heroku app:

heroku create [APP_NAME]

Push code to Heroku servers:

git push heroku master

Open Heroku app in browser:

heroku open

Or go directly via http://APP_NAME.herokuapp.com

View/stream server logs:

heroku logs --tail
You can’t perform that action at this time.