To add custom JS code in our Spring boot application follow the following steps:-
Create a folder called static under resources folder. You can put your static content in that folder.
For example the path to myapp.js would be resources\static\js\myapp.js
You can refer it your code with:-