How to develop a Battlesnake using a MuleSoft API and the DataWeave language
In this post:
If you’re not familiar with the modern Battlesnake game, you must at least remember the snake game from those old cell phones. It’s basically the same, but developing APIs and deploying them to the cloud...And fighting other snakes 😂
In this post, I’m going to guide you through all the steps to generate your own MuleSoft starter project in GitHub and be ready to start modifying your DataWeave code to move the snake.
Create your own GitHub repository
The first step is to get your own repo based on the Mule starter project that the great Manik created for us. To do this, you first have to go to the official list of Starter Projects in the Battlesnake documentation. Scroll down until you see the Mule and DataWeave Battlesnake Quickstart project created by Manik Magar and click on it.

Once you open Manik’s GitHub repo, click on the Use this template button and select Create a new repository.

Add any name you choose for your repo and click Create repository from template.

This will generate your own GitHub repo. You’re now ready to start modifying your code!
Personalize your snake
You can personalize your own snake. For example, changing its head/tail design or changing its color. You can modify this data at src/main/resources/application.yaml.
This is what Manik added to the starter project:
battlesnake:
config:
"apiversion": "1"
"author": "mmsonline"
"color" : "#888888"
"head" : "default"
"tail" : "default"
"version" : "0.0.1-beta"
And this is what I have for my snake:
battlesnake:
config:
"apiversion": "1"
"author": "alexandramartinez"
"color" : "#6c25be"
"head"