You can download WAR file here: [https://github.com/dev-whoan/MKWeb/tree/master/deploy]
Or you can clone from github, use json files under WebContent with modifying sources in src/com/mkweb.
- To operate MkWeb with cloning...
- You must change WebContent folder name into ROOT
- The sources you downloaded must be compiled and put them into ROOT/WEB-INF/classes folder
- com/mkweb/...
-
Place war file in servlet container such as Tomcat.
-
Unzip war file with starting servlet container as Administrator.
-
Go to /path/to/mkweb/ROOT/WEB-INF/classes/configs
-
Modify MkWeb.conf and require json configs and add Controllers you want to use.
- Controller means such as View Controllers, SQL Controllers, FTP Controllers, ...
- Restart the tomcat
- Place war file to specified location.
# Specified location; for example /mkweb/webapps/...
$ mkdir /mkweb/webapps
$ mv MkWeb.war /mkweb/webapps
- Allow Read/Write to servlet container for the location.
$ chown -R SERVLET_CONTAINER /mkweb
$ chmod -R 755 /mkweb
- Unzip the war file by starting servlet container.
# Tomcat@ → @ means number. for me, tomcat9
$ systemctl start tomcat@
- Rename the just unzipped folder into ROOT and go to configs folder under the folder.
$ cd /mkweb/webapps
$ mv MkWeb ROOT
# abs path: /mkweb/webapps/ROOT/WEB-INF/classes/configs
$ cd ROOT/WEB-INF/classes/configs
- Modify MkWeb.conf and require json configs and add Controller you want to use.
- Controller means such as View Controllers, SQL Controllers, FTP Controllers, ...
- Restart the tomcat
$ systemctl restart tomcat@
- If tomcat doesn't respond to log or any ftp requests, you need to check Servlet Container's permission level.
# For tomcat
$ cd /etc/systemd/system/multi-user.target.wants
# Modify Tomcat service
$ sudo vi [email protected]
#######tomcat9.service######
...
#Security
...
ReadWritePaths=/etc/tomcat@/Catalina/
ReadWritePaths=/var/lib/tomcat@/webapps/
ReadWritePaths=/var/log/tomcat@/
# Add your mkweb paths
ReadWritePaths=/mkweb/webapps/
After modify it, you need to change user/group of tomcat's umask.
$ vi /usr/share/tomcat@/bin/catalina.sh
### find UMASK, change it into 0022
...
if [ -z "$UMASK" ]; then
UMASK="0022"
fi
...
Save the catalina.sh, and restart the tomcat.
$ systemctl daemon-reload
$ systemctl restart tomcat9
-
Open the project with Java IDE.
-
Modify require json configs and the source you want to change.
- json configs are located in WebContent/WEB-INF/classes/configs
- Export Project to WAR file
-
For eclipse
- You can export it with Runnable Jar
- To export into Runnable jar, only sources should be exported.
- After exports jar file, located jar into your webapps jar lib, and copy the /WEB-INF/classes/configs into your /WEB-INF folder
- Or WAR file
- Follow [With War file] above.
- You can export it with Runnable Jar
- Follow [With War file] above.
- You should compile the project up to Java8
- If you use higher than Java8, you need to set your Servlet container's java version in a same version.
MkWeb is Web Server Framework based on Servlet.
You can use MkWeb with Web: JSP, HTML and even another front library like Reactjs, Vuejs. And Mobile application(iOS, Android)
Front developers should consider lots of things when they want to launch kind of services; Application, Web Site, Databases, etc.
Simply Front-End and Back-End.
And their ideas come from Front-End: 'How about creatinga food delivery service?', 'Why there is no service like ...'
However, they need to crew a team for developing their ideas; Backend developer, Frontend developer, Designer, ...
So MkWeb's idea is started with 'Front developer just need to focus on the Planning, Front-End easily View-side and user experience.
We are designing MkWeb with Independent MVSC pattern, inspired from MVC pattern.
We defined Model as server-side resources: DB, File server, Logger
We designed Controller as relationships between Model and Service
We defined Service as receiver which handles requests from front end software, such that Web, Mobile Application, ...
Service will handle the request by getting data by Controller and responsing it to requester
We allow Cross Platform. View is the front end software, such that Web(HTML, React, ...), Mobile Application(iOS, Android)
In MkWeb, you can use several offered Controllers.
To use those Controllers, you need to set, config them with modifying and adding JSON files.
And after you modify the json configs, you don't have to restart the webserver. The modifying information will be automatically covered. (however you have to restart when you create new one.)
JSON Configs are the biggest profit when you use MkWeb.
You can easily access to Model via Services and Controllers.
For example, you just need to set relevant Configs to access DB, one is about Page, and another is about Sql.
However, before using MkWeb you need to design DBA, DBO, and whatever you need to access to the DB.
Using MkWeb, the hassle is gone!
MkWeb includes MkLogger which logs everything happend in MkWeb.
MkLogger logs every tasks on MkWeb, so you can easily trace the currently situation in MkWeb.
-
Some JSON settings are wrong, and how can I fix it.
-
Someone request something, and how MkWeb responses about it.
-
Some error have occured, and what is wrong.
MkWeb can connect to RDBMS without programming about it.
You just need to set DB information on MkWeb.conf, and setting JSON for pages and sqls.
MkWeb supports RESTful API.
Request header content type must be application/json
.
GET
for getting data, POST
for generating data, PUT
for modifying data, DELETE
for deleting data, and HEAD
, OPTIONS
.
GET: You can get specify the target data with Document URI.
curl --request GET "http://localhost/users/name/Jhon"
POST: You can generate data with sending Body parameter.
curl --request POST "http://localhost/users" --data '{"name":"Jhon", "age":"23"}'
PUT: You can modify exists data or generating new data. Condition to search original data will be sent with Document URI, and new data will be sent in Body parameter.
curl --request PUT "http://localhost/users/name/Jhon" --data '{"age":"24"}'
DELETE: You can remove exists data with specifying in Body parmater
curl --request DELETE "http://localhost/users" --data '{"name":"Jhon"}'
pretty
: You can receive the response in pretty json.
curl --request GET "http://localhost/users?pretty"
paging
: You can paging the result datas.
curl --request GET "http://localhost/users?paging=5"
orderby
: You can ordering the result datas.
orderway
: You can specify the ordering method, DESC or ASC.
curl --request GET "http://localhost/users?orderby=name&orderway=desc"
- MKWeb을 사용하거나 복제, 배포할 때 해줬으면 하는 일
- Don't hesitate to feedback.
- We are opened for your feedback!
- Please scout us.