官术网_书友最值得收藏!

Using embedded web server and database

We are going to play with the embedded web server and database. The embedded web server and database are well-configured and run on startup by default. This lets developers rapidly develop the prototype of the virtual world without worrying about setting up different servers.

Running the embedded web server

By default, the web server is running on port 8080 with same SmartFoxServer location.

After starting up the SmartFoxServer, go to http://localhost:8080 in the web browser. If a webpage shows up with a message "SmartFoxServer Pro 1.6.6 is installed successfully", it means the server is working with default settings.

The HTTP documents directory of the embedded server is located in Installation folder | Server | webserver | webapps | root. You can modify and store static web pages within this folder to host the virtual world website.

Running the embedded database server

The embedded H2 database server is well-configured upon SmartFoxServer installation.

Windows users can launch the H2 Database Admin Tool by double-clicking the adminDB.bat, which is located in SmartFoxServer installation directory | Server. Linux and Mac users can launch by executing the following command in the terminal in the Server directory:

chmod +x adminDB.sh ./adminDB.sh

After executing the adminDB script, a web interface of the Admin tool will open in browser.

We will use the default saved settings to connect the H2 database. In Windows and Linux, the default setting is Generic H2, while in Mac, the setting is called Generic H2 (Embedded).

If the development is based on H2 Database engine, we can test the database by clicking the Connect button with default settings.

After connected to the H2 database engine, the admin panel is divided into three parts. The upper part contains action buttons for operating the database such as the logout or execute commands. The left part lists all available users and tables. The right part is for inputting the SQL commands and viewing the results. H2 database is a light-weight engine that we need to operate the database by typing all the SQL commands ourselves.

主站蜘蛛池模板: 元朗区| 西盟| 澄城县| 屏山县| 阳曲县| 泾源县| 高碑店市| 呼和浩特市| 青川县| 罗平县| 盐亭县| 郸城县| 菏泽市| 莱阳市| 四平市| 永登县| 多伦县| 瓦房店市| 无锡市| 讷河市| 墨脱县| 稷山县| 新营市| 偃师市| 临漳县| 瑞丽市| 绥滨县| 白河县| 甘南县| 宁南县| 赣榆县| 长乐市| 临沧市| 雅江县| 石嘴山市| 右玉县| 罗源县| 清远市| 略阳县| 民勤县| 乌海市|