Currently, there are two ways to call the interface of applets:
- Call online data interface, such as aggregation, easy source data, etc.;
- Own server interface;
Obviously, the first way is more focused on the small program itself, just need to call someone else written interface on the line, but in addition to the interface will charge, there is the biggest disadvantage, that is not free! There is no way to store user data and add desired functionality. For a simple example, do a good "ABC" applet, if you call easy source data interface, then want to achieve statistical like function is not able to achieve, visible if you call someone else's interface to meet the basic function of the applet is difficult to achieve.
Here we come together to do a fully functional small program, have their own server, probably steps are:
- Have a cloud server
- Domain name (applets must call the interface by accessing the domain name)
- Apply for SSL certificate and configure it to the server (applets must use HTTPS)
Apply for an SSL certificate and configure it on the server
Since access to the background in the applet must be through HTTPS, we also need to apply for an SSL certificate
Publish the project to the server and start it
- Joint tuning applet
- Release applets
Configure HTTPS and associate the certificates that we have uploaded and approved.
Then it is time to configure and start Tomcat with the following configuration file (upload the JKS file of the certificate to our server, then directly add these lines and modify the configuration) :
<Connector port="443" protocol="org.apache.coyote.http11.Http11NioProtocol" maxThreads="150" SSLEnabled="true"> <SSLHostConfig> <Certificate certificateKeystoreFile="cert/ABC.fun.jks" certificateKeyAlias="ABC.fun" certificateKeystorePassword="CTCpassword" type="RSA" /> </SSLHostConfig> </Connector>
Finally, open 443 port of the cloud server.