1
0
Fork 0
mirror of https://github.com/edgurgel/httparrot synced 2025-04-06 00:32:34 -04:00

Compare commits

..

3 commits

Author SHA1 Message Date
edgurgel
cb6373be97 Update URLs to point to render URL 2024-06-26 21:54:55 +12:00
edgurgel
e716a1a327 Add render build script 2024-06-26 21:41:50 +12:00
edgurgel
4f87d8262a mix release.init 2024-06-26 21:37:33 +12:00
8 changed files with 80 additions and 37 deletions

10
build.sh Executable file
View file

@ -0,0 +1,10 @@
#!/usr/bin/env bash
# exit on error
set -o errexit
# Initial setup
mix deps.get --only prod
MIX_ENV=prod mix compile
# Build the release and overwrite the existing release directory
MIX_ENV=prod mix release --overwrite

View file

@ -41,7 +41,7 @@ defmodule Httparrot.Mixfile do
licenses: ["MIT"], licenses: ["MIT"],
links: %{ links: %{
"Github" => @source_url, "Github" => @source_url,
"HTTParrot" => "http://httparrot.herokuapp.com", "HTTParrot" => "https://httparrot.onrender.com/",
"httpbin" => "http://httpbin.org" "httpbin" => "http://httpbin.org"
} }
] ]

View file

@ -56,7 +56,7 @@
<div class='mp'> <div class='mp'>
<h1>httparrot(1): HTTP Request &amp; Response Service</h1> <h1>httparrot(1): HTTP Request &amp; Response Service</h1>
<p>Freely hosted in <a href="http://httparrot.herokuapp.com">HTTP</a> &amp; <a href="https://httparrot.herokuapp.com">HTTPS</a> <p>Freely hosted in <a href="https://httparrot.onrender.com/">HTTPS</a>
<h2 id="ENDPOINTS">ENDPOINTS</h2> <h2 id="ENDPOINTS">ENDPOINTS</h2>
@ -104,34 +104,46 @@ scenarios. Additional endpoints are being considered (e.g. <code>/deflate</code>
<h2 id="EXAMPLES">EXAMPLES</h2> <h2 id="EXAMPLES">EXAMPLES</h2>
<h3 id="-curl-http-httparrot-org-ip">$ curl http://httparrot.herokuapp.com/ip</h3> <h3 id="-curl-http-httparrot-org-ip">$ curl https://httparrot.onrender.com/</h3>
<pre><code>{"origin": "24.127.96.129"} <pre><code>{"origin": "24.127.96.129"}
</code></pre> </code></pre>
<h3 id="-curl-http-httparrot-org-user-agent">$ curl http://httparrot.herokuapp.com/user-agent</h3> <h3 id="-curl-http-httparrot-org-user-agent">$ curl https://httparrot.onrender.com/user-agent</h3>
<pre><code>{"user-agent": "curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8l zlib/1.2.3"} <pre><code>{"user-agent": "curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8l zlib/1.2.3"}
</code></pre> </code></pre>
<h3 id="-curl-http-httparrot-org-get">$ curl http://httparrot.herokuapp.com/get</h3> <h3 id="-curl-http-httparrot-org-get">$ curl https://httparrot.onrender.com/get</h3>
<pre><code>{ <pre><code>
"args": {}, {
"headers": { "args": {},
"Accept": "*/*", "headers": {
"Connection": "close", "accept": "*/*",
"Content-Length": "", "accept-encoding": "gzip",
"Content-Type": "", "cdn-loop": "cloudflare; subreqs=1",
"Host": "httparrot.herokuapp.com", "cf-connecting-ip": "118.148.71.18",
"User-Agent": "curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8l zlib/1.2.3" "cf-ew-via": "15",
}, "cf-ipcountry": "NZ",
"origin": "24.127.96.129", "cf-ray": "899c4ca20494508c-AKL",
"url": "http://httparrot.herokuapp.com/get" "cf-visitor": "{\"scheme\":\"https\"}",
} "cf-worker": "onrender.com",
"host": "httparrot.onrender.com",
"render-proxy-ttl": "4",
"rndr-id": "1cf65e46-55f1-429d",
"true-client-ip": "118.148.71.18",
"user-agent": "curl/7.81.0",
"x-forwarded-for": "118.148.71.18, 10.213.36.192, 10.214.43.80",
"x-forwarded-proto": "https",
"x-request-start": "1719395492280333"
},
"url": "http://httparrot.onrender.com/get",
"origin": ""
}
</code></pre> </code></pre>
<h3 id="-curl-I-http-httparrot-org-status-418">$ curl -I http://httparrot.herokuapp.com/status/201</h3> <h3 id="-curl-I-http-httparrot-org-status-418">$ curl -I https://httparrot.onrender.com/status/201</h3>
<pre><code>HTTP/1.1 201 <pre><code>HTTP/1.1 201
Server: Cowboy Server: Cowboy

View file

@ -1,6 +1,8 @@
@echo off @echo off
rem Set the release to work across nodes. If using the long name format like rem Set the release to load code on demand (interactive) instead of preloading (embedded).
rem the one below (my_app@127.0.0.1), you need to also uncomment the rem set RELEASE_MODE=interactive
rem RELEASE_DISTRIBUTION variable below.
rem Set the release to work across nodes.
rem RELEASE_DISTRIBUTION must be "sname" (local), "name" (distributed) or "none".
rem set RELEASE_DISTRIBUTION=name rem set RELEASE_DISTRIBUTION=name
rem set RELEASE_NODE=<%= @release.name %>@127.0.0.1 rem set RELEASE_NODE=<%= @release.name %>

View file

@ -1,14 +1,20 @@
#!/bin/sh #!/bin/sh
# Sets and enables heart (recommended only in daemon mode) # # Sets and enables heart (recommended only in daemon mode)
# if [ "$RELEASE_COMMAND" = "daemon" ] || [ "$RELEASE_COMMAND" = "daemon_iex" ]; then # case $RELEASE_COMMAND in
# HEART_COMMAND="$RELEASE_ROOT/bin/$RELEASE_NAME $RELEASE_COMMAND" # daemon*)
# export HEART_COMMAND # HEART_COMMAND="$RELEASE_ROOT/bin/$RELEASE_NAME $RELEASE_COMMAND"
# export ELIXIR_ERL_OPTIONS="-heart" # export HEART_COMMAND
# fi # export ELIXIR_ERL_OPTIONS="-heart"
# ;;
# *)
# ;;
# esac
# Set the release to work across nodes. If using the long name format like # # Set the release to load code on demand (interactive) instead of preloading (embedded).
# the one below (my_app@127.0.0.1), you need to also uncomment the # export RELEASE_MODE=interactive
# RELEASE_DISTRIBUTION variable below.
# # Set the release to work across nodes.
# # RELEASE_DISTRIBUTION must be "sname" (local), "name" (distributed) or "none".
# export RELEASE_DISTRIBUTION=name # export RELEASE_DISTRIBUTION=name
# export RELEASE_NODE=<%= @release.name %>@127.0.0.1 # export RELEASE_NODE=<%= @release.name %>

12
rel/remote.vm.args.eex Normal file
View file

@ -0,0 +1,12 @@
## Customize flags given to the VM: https://www.erlang.org/doc/man/erl.html
## -mode/-name/-sname/-setcookie are configured via env vars, do not set them here
## Increase number of concurrent ports/sockets
##+Q 65536
## Tweak GC to run more often
##-env ERL_FULLSWEEP_AFTER 10
## Enable deployment without epmd
## (requires changing both vm.args and remote.vm.args)
##-start_epmd false -erl_epmd_port 6789 -dist_listen false

View file

@ -1,11 +1,12 @@
## Customize flags given to the VM: http://erlang.org/doc/man/erl.html ## Customize flags given to the VM: https://www.erlang.org/doc/man/erl.html
## -mode/-name/-sname/-setcookie are configured via env vars, do not set them here ## -mode/-name/-sname/-setcookie are configured via env vars, do not set them here
## Number of dirty schedulers doing IO work (file, sockets, etc)
##+SDio 5
## Increase number of concurrent ports/sockets ## Increase number of concurrent ports/sockets
##+Q 65536 ##+Q 65536
## Tweak GC to run more often ## Tweak GC to run more often
##-env ERL_FULLSWEEP_AFTER 10 ##-env ERL_FULLSWEEP_AFTER 10
## Enable deployment without epmd
## (requires changing both vm.args and remote.vm.args)
##-start_epmd false -erl_epmd_port 6789false