Hello world,
I want to set up a server, that has a webfrontend, access to a database and some logic. In my case it is a simple "Hammurabi"-game, which everyone can play. Maybe in the future it gets some features, where the player get some advantages, when he does something in the "hive" world, i.e. some advertising. And in the long run I maybe want to benefit the player with some token. But that is far in the future.
In this post I explain how to set up a simple web server, that runs on java spring boot:
Preparing git
I have created a folder, which I want to synch with github. So I created in Github a new branch from my existing Hammurabi repository. (There I have created some simple game logic in the past. I want to merge it later with the springboot-server we install now).
On my local folder I checked out this new branch.
The I deleted the content via the file explorer.
(The "ll" was done after I have unpacked the content from start.spring.io in this folder):
Creating Spring Boot Server from scratch
Go to https://start.spring.io/ and fill out the content like this:
It is very important to write the right package name. By default the artifact-name is added. This leads to very strange errors. The package name has to be the same as the group name!
I unpacked the downloaded jar file into the prepared git folder:
I started the folder with IntelliJI:
I created a new package named org.chary.controller and created a new java file there:
After that I started the HammurabiApplication and checked with the browser, if I can reach it: It works!
Don't forget to:
git add .
git commit -m "springboot from scratch"
git push
You can find my code on Github: https://github.com/achimmertens/Hammurabi. (Be aware, that it is not finished at the moment).
In my next post, I explain how to push this server to a docker container in a raspberry pi.
Regards, Achim
Congratulations @achimmertens! You have completed the following achievement on the Hive blockchain and have been rewarded with new badge(s):
Your next target is to reach 36000 upvotes.
You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word
STOP
To support your work, I also upvoted your post!
Check out the last post from @hivebuzz:
Support the HiveBuzz project. Vote for our proposal!