Skip to content
Search
Generic filters
Exact matches only

A-Z Julia Endpoint With Genie

mkdir CarPrice
mv mdl.jld2 ./CarPrice
mkdir endp
cd endp
julia
using Genie
Genie.newapp_webservice("CarPricePredictor")
using Genie.Routerroute("/") do
mdl = @load "models/mdl.jld2"
end
using Genie.Routerroute("/") do
mdl = @load "models/mdl.jld2"
year = haskey(@params, :year)
end
using Genie.Routerroute("/") do
mdl = @load "models/mdl.jld2"
year = haskey(@params, :year)
return(mdl.predict(year))
end
ssh [email protected](this_is_my_ip)
cd /var/www
git clone https://github.com/emmettgb/CarPricePredictor
sudo dnf/apt/pacman/man install nginx
sudo nano /etc/nginx/conf.d/carpredictor.conf
server {
listen 80;
server_name your domain;

location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}

sudo unlink /etc/nginx/sites-enabled/default
sudo apt-get install supervisor
sudo nano /etc/supervisor/conf.d/flask_app.conf
[program:genieapp]
directory=/var/www/CarPricePredictor
command=. bin/server
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
stderr_logfile=/var/log/appname/lognameerr.log
stdout_logfile=/var/log/appname/lognamestdout.log
sudo nginx -s reload
sudo service supervisor reload

And now our endpoint is deployed!