Skip to content

Commit d505fd4

Browse files
committed
chore: build project scaffold
1 parent b13905b commit d505fd4

File tree

12 files changed

+120
-106
lines changed

12 files changed

+120
-106
lines changed

.github/CODEOWNERS

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Each line is a file pattern followed by one or more owners.
2+
3+
# These owners will be the default owners for everything in
4+
# the repo. Unless a later match takes precedence,
5+
# users listed below will be requested for
6+
# review when someone opens a pull request.
7+
8+
* @EstebanBorai

.github/workflows/build.yml

+13-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- main
77

88
jobs:
9-
ci:
9+
build:
1010
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
@@ -18,7 +18,18 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@v2
2020

21-
- name: Build
21+
- name: Cache .cargo and target
22+
uses: actions/cache@v2
23+
with:
24+
path: |
25+
~/.cargo
26+
./target
27+
key: ${{ runner.os }}-${{ matrix.rust }}-cargo-build-${{ hashFiles('**/Cargo.toml') }}
28+
restore-keys: |
29+
${{ runner.os }}-${{ matrix.rust }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
30+
${{ runner.os }}-${{ matrix.rust }}-cargo-build-
31+
32+
- name: cargo build
2233
uses: actions-rs/cargo@v1
2334
with:
2435
command: build

.github/workflows/clippy.yml

+14-12
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
name: clippy/fmt
2-
1+
name: clippy
32
on:
43
pull_request:
54
push:
65
branches:
76
- main
87

98
jobs:
10-
clippy_fmt:
11-
name: Runs Clippy and Fmt
9+
clippy:
1210
runs-on: ubuntu-latest
1311
strategy:
1412
matrix:
@@ -18,23 +16,27 @@ jobs:
1816
- nightly
1917

2018
steps:
21-
- name: Checkout
22-
uses: actions/checkout@v2
19+
- uses: actions/checkout@v2
2320

2421
- uses: actions-rs/toolchain@v1
2522
with:
2623
profile: minimal
2724
toolchain: ${{ matrix.rust }}
2825
override: true
29-
components: rustfmt, clippy
26+
components: clippy
3027

31-
- name: Run fmt
32-
uses: actions-rs/cargo@v1
28+
- name: Cache .cargo and target
29+
uses: actions/cache@v2
3330
with:
34-
command: fmt
35-
args: --all -- --check
31+
path: |
32+
~/.cargo
33+
./target
34+
key: ${{ runner.os }}-${{ matrix.rust }}-cargo-clippy-${{ hashFiles('**/Cargo.lock') }}
35+
restore-keys: |
36+
${{ runner.os }}-${{ matrix.rust }}-cargo-clippy-${{ hashFiles('**/Cargo.lock') }}
37+
${{ runner.os }}-${{ matrix.rust }}-cargo-clippy-
3638
37-
- name: Run clippy
39+
- name: cargo clippy
3840
uses: actions-rs/cargo@v1
3941
with:
4042
command: clippy

.github/workflows/fmt.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: fmt
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
fmt:
10+
name: fmt
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
rust:
15+
- stable
16+
- beta
17+
- nightly
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v2
22+
23+
- uses: actions-rs/toolchain@v1
24+
with:
25+
profile: minimal
26+
toolchain: ${{ matrix.rust }}
27+
override: true
28+
components: rustfmt
29+
30+
- name: Run fmt
31+
uses: actions-rs/cargo@v1
32+
with:
33+
command: fmt
34+
args: --all -- --check

.github/workflows/test.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: test
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
rust:
14+
- stable
15+
- beta
16+
- nightly
17+
steps:
18+
- uses: actions/checkout@v2
19+
20+
- name: Cache .cargo and target
21+
uses: actions/cache@v2
22+
with:
23+
path: |
24+
~/.cargo
25+
./target
26+
key: ${{ runner.os }}-${{ matrix.rust }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}
27+
restore-keys: |
28+
${{ runner.os }}-${{ matrix.rust }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}
29+
${{ runner.os }}-${{ matrix.rust }}-cargo-test-
30+
- name: cargo test
31+
uses: actions-rs/cargo@v1
32+
with:
33+
command: test

.gitignore

+3-5
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ ehthumbs.db
4545
Thumbs.db
4646

4747

48-
#Added by cargo
49-
#
50-
#already existing elements were commented out
51-
52-
#/target
48+
# Cargo #
49+
#########
50+
/target

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Contributing to http-server
1+
# Contributing
22

33
* [Code of Conduct](#code-of-conduct)
44
* [Pull Requests](#pull-requests)

Cargo.toml

+4-9
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
[package]
22
name = "http-server"
3-
version = "0.0.9"
3+
version = "0.1.0"
44
authors = ["Esteban Borai <[email protected]>"]
55
edition = "2018"
6-
license = "MIT"
7-
description = "Command-line HTTP Server"
8-
readme = "README.md"
9-
repository = "https://github.com/EstebanBorai/http-server"
6+
description = "Configurable and simple command-line HTTP server"
7+
repository = "https://github.com/http-server-rs/http-server"
108
categories = ["web-programming", "web-programming::http-server"]
9+
keywords = ["configurable", "file", "http", "server", "serve", "static"]
1110

1211
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1312

1413
[dependencies]
15-
ascii = "0.8"
16-
clap = "2.33.3"
17-
mime_guess = "2.0"
18-
tiny_http = "0.6"

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2020 Esteban Borai and Contributors
1+
Copyright (c) 2021 Esteban Borai and Contributors
22

33
Permission is hereby granted, free of charge, to any
44
person obtaining a copy of this software and associated

README.md

+5-76
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,15 @@
11
<div>
2-
<div align="center" style="display: block; text-align: center;">
3-
<img src="https://raw.githubusercontent.com/EstebanBorai/http-server/main/docs/http-logo.png" height="120" width="200" />
4-
</div>
52
<h1 align="center">http-server</h1>
6-
<h4 align="center">Command-line HTTP Server</h4>
3+
<h4 align="center">Configurable and simple command-line HTTP server</h4>
74
</div>
85

96
<div align="center">
107

118
[![Crates.io](https://img.shields.io/crates/v/http-server.svg)](https://crates.io/crates/http-server)
129
[![Documentation](https://docs.rs/http-server/badge.svg)](https://docs.rs/http-server)
13-
![Build](https://github.com/EstebanBorai/http-server/workflows/build/badge.svg)
14-
![Lint](https://github.com/EstebanBorai/http-server/workflows/clippy/fmt/badge.svg)
15-
![Tests](https://github.com/EstebanBorai/http-server/workflows/tests/badge.svg)
10+
![Build](https://github.com/http-server-rs/http-server/workflows/build/badge.svg)
11+
![Clippy](https://github.com/http-server-rs/http-server/workflows/clippy/badge.svg)
12+
![Formatter](https://github.com/http-server-rs/http-server/workflows/fmt/badge.svg)
13+
![Tests](https://github.com/http-server-rs/http-server/workflows/test/badge.svg)
1614

1715
</div>
18-
19-
## Index
20-
21-
- [Installation](#installation)
22-
- [Usage](#usage)
23-
- [Flags](#flags)
24-
- [Options](#options)
25-
- [Contributing](#contributing)
26-
- [License](#license)
27-
- [Contribution](#contribution)
28-
29-
## Installation
30-
31-
```bash
32-
cargo install http-server
33-
```
34-
35-
Check for the installation to be successful.
36-
37-
```bash
38-
http-server --help
39-
```
40-
41-
## Usage
42-
43-
```
44-
http-server [FLAGS] [OPTIONS] [root_dir]
45-
```
46-
47-
### Flags
48-
49-
Flags are provided without any values. For example:
50-
51-
```
52-
http-server --help
53-
```
54-
55-
Name | Short | Long | Description
56-
--- | --- | --- | ---
57-
Help | `h` | `help` | Prints help information
58-
Version | `V` | `version` | Prints version information
59-
60-
### Options
61-
62-
Options are provided with a value and also have default values. For example:
63-
64-
```
65-
http-server --address 127.0.0.1
66-
```
67-
68-
Name | Short | Long | Description | Default Value
69-
--- | --- | --- | --- | ---
70-
Address | `a` | `address` | Address to bind the server | `0.0.0.0`
71-
Port | `p` | `port` | Port to bind the server | `7878`
72-
73-
## Contributing
74-
75-
Every contribution to this project is welcome. Feel free to open a pull request,
76-
an issue or just by starting this project.
77-
78-
## License
79-
80-
Licensed under the MIT License
81-
82-
### Contribution
83-
84-
Unless you explicitly state otherwise, any contribution intentionally submitted for
85-
inclusion in http-server by you, shall be dual licensed as above, without any additional
86-
terms or conditions.

src/bin/main.rs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
println!("Hello, HTTP Server!");
3+
}

src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

0 commit comments

Comments
 (0)