🚴♀️When Beginners would like to build a server by any language, or use curl command, or understand...🚴♂️
After Download, you can build a server by Go, Python, JavaScript(Deno), Ruby, Node.js, Bun, PHP, Elixir, or Rust — all with a single one-liner command!
You can practice using curl command, understand how to build a server, or customize to your liking.
Note You can use with ease because you can build a server at localhost(127.0.0.1)🫶
Note Because localhost can be seen by only you, and it is not public🤠
POST: A server will acknowledge, and response the message if you send correct request including the arguments of 'text' and 'number'
GET: A server will acknowledge the request, although a server won't response to Client
Note Actually, it's no relations, and it's no problem you change the number of port.
Note Wiki is updated occasionally for Beginners.
For Beginners, it is used different port at any language, though.
- Go -> localhost:3010
- Python -> localhost:3020
- JavaScript(Deno) -> localhost:3030
- Ruby -> localhost:3040
- Node.js -> localhost:3050
- Bun -> localhost:3060
- PHP -> localhost:3070
- Elixir -> localhost:3080
- Rust -> localhost:3090
go version go1.22.0 darwin/arm64 when I confirmed by using
go version
go run main.go
curl -X POST -d 'text=ニコニコ' -d 'number=2525' localhost:3010/admin
Server is started at http://localhost:3010
Accepted Control message, Text: ニコニコ, Number: 2525
Sent Control message about Text: ニコニコ, Number: 2525
Python 3.12.0 when I confirmed by using
python --versionNote startswith() can be used since Python 3.9
python main.py
curl -X POST -d 'text=ニコニコ' -d 'number=2525' localhost:3020/admin
Server is started at http://localhost:3020
Accepted Control message: Text: ニコニコ, Number: 2525
OK, Accepted Control message: Text: ニコニコ, Number: 2525
Updated to use
Deno.serve()— the recommended API since Deno v1.35 / v2.x (no import needed).
deno 2.0.0, v8 13.x, typescript 5.x when I confirmed by using
deno --version
deno run --allow-net main.ts
curl -X POST -d 'text=ニコニコ' -d 'number=2525' localhost:3030/admin
Server is started at http://localhost:3030
Listening on http://localhost:3030/
Accepted Control message, Text: ニコニコ, Number: 2525
OK, Accepted Control message, Text: ニコニコ, Number: 2525
ruby 3.3.0 (2023-12-25) [arm64-darwin23] when I confirmed by using
ruby -vNote you must run
gem install webrickif you haven't installed it
ruby main.rb
curl -X POST -d 'text=ニコニコ' -d 'number=2525' localhost:3040/admin
Server is started at http://localhost:3040
[2024-01-01 12:00:00] INFO WEBrick 1.8.1
Accepted Control message, Text: ニコニコ, Number: 2525
OK, Accepted Control message, Text: ニコニコ, Number: 2525
v22.0.0 when I confirmed by using
node --versionNote Uses only the built-in
node:httpmodule — no npm install needed
node main.mjs
curl -X POST -d 'text=ニコニコ' -d 'number=2525' localhost:3050/admin
Server is started at http://localhost:3050
Accepted Control message, Text: ニコニコ, Number: 2525
OK, Accepted Control message, Text: ニコニコ, Number: 2525
1.1.0 when I confirmed by using
bun --versionNote Uses Bun's built-in
Bun.serve()— no package install needed
bun main.bun.ts
curl -X POST -d 'text=ニコニコ' -d 'number=2525' localhost:3060/admin
Server is started at http://localhost:3060
Accepted Control message, Text: ニコニコ, Number: 2525
OK, Accepted Control message, Text: ニコニコ, Number: 2525
PHP 8.3.0 when I confirmed by using
php --versionNote Uses PHP's built-in web server — no framework or composer needed
php -S localhost:3070 main.php
curl -X POST -d 'text=ニコニコ' -d 'number=2525' localhost:3070/admin
Server is started at http://localhost:3070
Accepted Control message, Text: ニコニコ, Number: 2525
OK, Accepted Control message, Text: ニコニコ, Number: 2525
Elixir 1.16.0 (compiled with Erlang/OTP 26) when I confirmed by using
elixir --versionNote Uses
:gen_tcpfrom Erlang/OTP standard library — no mix project needed
elixir main.exs
curl -X POST -d 'text=ニコニコ' -d 'number=2525' localhost:3080/admin
Server is started at http://localhost:3080
Accepted Control message, Text: ニコニコ, Number: 2525
OK, Accepted Control message, Text: ニコニコ, Number: 2525
rustc 1.78.0 when I confirmed by using
rustc --versionNote Uses only the Rust standard library (
std::net) — no external crates needed
cargo run
Run this command inside the
rust/directory.
curl -X POST -d 'text=ニコニコ' -d 'number=2525' localhost:3090/admin
Server is started at http://localhost:3090
Accepted Control message, Text: ニコニコ, Number: 2525
OK, Accepted Control message, Text: ニコニコ, Number: 2525