כיצד להריץ קוד בצד השרת בלחיצה על כפתור?

Then you’ll need to make an Ajax request to an endpoint that runs that code.

Can you say more about what you want to happen on the server side?