https://github.com/newtypegeek/web-rust
Trial on Rust Actix-Web
https://github.com/newtypegeek/web-rust
actix-web rust
Last synced: 10 months ago
JSON representation
Trial on Rust Actix-Web
- Host: GitHub
- URL: https://github.com/newtypegeek/web-rust
- Owner: newTypeGeek
- License: mit
- Created: 2023-02-19T03:23:11.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-02-26T07:42:40.000Z (over 3 years ago)
- Last Synced: 2025-03-30T23:28:36.660Z (about 1 year ago)
- Topics: actix-web, rust
- Language: Rust
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# web-rust
Trial on web-server using Rust
## Getting Started
1. Clone this repository
`git clone https://github.com/newTypeGeek/web-rust.git`
2. Install Rust: https://www.rust-lang.org/tools/install
3. Build the executable binary using `Cargo`
`cd /path/to/web-rust/`
`cargo build`
4. Run the compiled binary file
```commandline
❯ target/debug/web-rust
[2023-02-26T07:31:22.538Z INFO actix_server::builder] starting 4 workers
[2023-02-26T07:31:22.538Z INFO actix_server::server] Actix runtime found; starting in Actix runtime
```
5. Open a web browser and type `http://0.0.0.0:8080`. You would see `Hello world!`
## Run in Docker
1. Install Docker https://docs.docker.com/get-docker/
2. Build a docker image
`cd /path/to/web-rust/`
`docker build --rm -t web-rust -f Dockerfile .`
3. Create a docker container
`docker run -p 8080:8080 --name web-rust web-rust:latest`
4. Check the docker container is running normally
```commandline
❯ docker logs web-rust
[2023-02-26T07:38:05.092Z INFO actix_server::builder] starting 2 workers
[2023-02-26T07:38:05.092Z INFO actix_server::server] Actix runtime found; starting in Actix runtime
```
5. Open a web browser and type `http://0.0.0.0:8080`. You would see `Hello world!`