Don't do complicated things. For individual developers. I'll make a rough article.
Small framework (as is) The point is that you can launch a Web service with the micro framework alone.
It is a personal usage. Web-like parts are obediently thrown to Nginx, Apache, PHP. Create a Web API for the local network with a micro framework and use Nginx or Apache as the front end.
Sinatra(Ruby) http://www.sinatrarb.com/intro-ja.html Installation is
command
gem install sinatra
The smallest code is
main.rb
require 'sinatra'
get '/' do
'Hello world!'
end
Public
command
ruby main.rb -p port number-o 0.0.0.0
Spark(Java) http://sparkjava.com/ Installation is
Just DL and pass the path. With Gradle
script
Gradle : compile "com.sparkjava:spark-core:2.5.4" //add to build.gradle
The smallest code is
main.java
import static spark.Spark.*;
public class HelloWorld {
public static void main(String[] args) {
get("/hello", (req, res) -> "Hello World");
}
}
Please compile the publication and execute the jart ball.
Bottle(Python) http://bottlepy.org/docs/dev/ It's light to install, so you can just download it, or use Package Manager or easy_install. If you use pip
command
sudo pip install bottle
The smallest code is
main.py
from bottle import route, run, template
@route('/hello/<name>')
def index(name):
return template('<b>Hello {{name}}</b>!', name=name)
run(host='localhost', port=8080)
Public
command
python main.py
is.
Regular expression Tenkomori web service that can be used in Japanese A web service that can also be used for machine learning A web service that can be ported anywhere and do some work Placing the Web API on the local network is also better for security.
You don't have to study tomcat, Rails, or Django (this is an exaggeration). Easy to distribute, install and test. If you use the server application as API, you can link in each language. You can separate the front end and the server side.
Recommended Posts