This commit is contained in:
parent
1bdee4ee36
commit
14cd21dc1c
17
README.md
17
README.md
@ -1,6 +1,6 @@
|
||||
# Hits-of-Code
|
||||
|
||||
[](https://hitsofcode.com/view/github/vbrandl/hoc)
|
||||
[](https://hitsofcode.com/github/vbrandl/hoc/view)
|
||||
[](https://drone.vbrandl.net/vbrandl/hoc)
|
||||
[](https://gitlab.com/vbrandl/hoc/pipelines)
|
||||
[](https://deps.rs/repo/github/vbrandl/hoc)
|
||||
@ -26,7 +26,7 @@ where `<service>` is one of `gitub`, `gitlab` or `bitbucket`. The HoC data can a
|
||||
https://<host>/<service>/<user>/<repo>/json
|
||||
```
|
||||
|
||||
There is also an overview page available via `https://<host>/view/<service>/<user>/<repo>`
|
||||
There is also an overview page available via `https://<host>/<service>/<user>/<repo>/view`
|
||||
|
||||
To delete a repository and the cache from the server, send a `POST` request to
|
||||
`https://<host>/<service>/<user>/<repo>/delete`. On the overview page, there is a button to perform this operation. It
|
||||
@ -48,18 +48,15 @@ $ docker build .
|
||||
|
||||
inside the repository.
|
||||
|
||||
I'm currently working on migrating to [nix](https://nixos.org/nix). To get a
|
||||
development shell, run `nix-shell`, to build the package run `nix-build --attr
|
||||
package` and to build the Docker image, run `nix-build --attr dockerImage`.
|
||||
I'm currently working on migrating to [nix](https://nixos.org/nix). To get a development shell, run `nix-shell`, to
|
||||
build the package run `nix-build --attr package` and to build the Docker image, run `nix-build --attr dockerImage`.
|
||||
|
||||
|
||||
## Running
|
||||
|
||||
Rename [`hoc.toml.example`](./hoc.toml.example) to `hoc.toml` or
|
||||
[`.env.example`](./.env.example) to `.env` and set the correct value for
|
||||
`base_url`/`HOC_BASE_URL`. If you don't want to use a configuration or dotenv
|
||||
file, you can pass all parameters directly via environment variables. For
|
||||
variable names see [`.env.example`](./.env.example).
|
||||
Rename [`hoc.toml.example`](./hoc.toml.example) to `hoc.toml` or [`.env.example`](./.env.example) to `.env` and set the
|
||||
correct value for `base_url`/`HOC_BASE_URL`. If you don't want to use a configuration or dotenv file, you can pass all
|
||||
parameters directly via environment variables. For variable names see [`.env.example`](./.env.example).
|
||||
|
||||
To start a local instance of the service just run:
|
||||
|
||||
|
@ -215,7 +215,7 @@ where
|
||||
Ok(HttpResponse::TemporaryRedirect()
|
||||
.header(
|
||||
LOCATION,
|
||||
format!("/view/{}/{}/{}", T::url_path(), data.0, data.1),
|
||||
format!("/{}/{}/{}/view", T::url_path(), data.0, data.1),
|
||||
)
|
||||
.finish())
|
||||
};
|
||||
@ -475,6 +475,9 @@ async fn start_server() -> std::io::Result<()> {
|
||||
.service(web::resource("/view/github/{user}/{repo}").to(overview::<GitHub>))
|
||||
.service(web::resource("/view/gitlab/{user}/{repo}").to(overview::<Gitlab>))
|
||||
.service(web::resource("/view/bitbucket/{user}/{repo}").to(overview::<Bitbucket>))
|
||||
.service(web::resource("/github/{user}/{repo}/view").to(overview::<GitHub>))
|
||||
.service(web::resource("/gitlab/{user}/{repo}/view").to(overview::<Gitlab>))
|
||||
.service(web::resource("/bitbucket/{user}/{repo}/view").to(overview::<Bitbucket>))
|
||||
.default_service(web::resource("").route(web::get().to(async_p404)))
|
||||
})
|
||||
.workers(OPT.workers)
|
||||
|
@ -10,7 +10,7 @@ Here is the markdown for the badge for <a href="https://@url/@path">@url/@path</
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
[](@base_url/view/@service/@path)
|
||||
[](@base_url/@service/@path/view)
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
@ -18,6 +18,6 @@ It will be rendered like this
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<a href="@base_url/view/@service/@path"><img src="@base_url/@service/@path" alt="example badge" /></a>
|
||||
<a href="@base_url/@service/@path/view"><img src="@base_url/@service/@path" alt="example badge" /></a>
|
||||
</pre>
|
||||
}, version_info, repo_count)
|
||||
|
@ -24,7 +24,7 @@ used for GitHub, GitLab and Bitbucket repositories. Just put the following code
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
[](@base_url/view/<service>/<user>/<repo>)
|
||||
[](@base_url/<service>/<user>/<repo>/view)
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
@ -33,7 +33,7 @@ following Markdown
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
[](@base_url/view/github/vbrandl/hoc)
|
||||
[](@base_url/github/vbrandl/hoc/view)
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
@ -41,7 +41,7 @@ would render this badge:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<a href="@base_url/view/github/vbrandl/hoc"><img src="@base_url/github/vbrandl/hoc"
|
||||
<a href="@base_url/github/vbrandl/hoc/view"><img src="@base_url/github/vbrandl/hoc"
|
||||
alt="example badge" /></a>
|
||||
</pre>
|
||||
|
||||
|
@ -19,7 +19,7 @@ To include the badge in your readme, use the following markdown:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
[](@repo_info.base_url/view/@repo_info.path?branch=@repo_info.branch)
|
||||
[](@repo_info.base_url/@repo_info.path?branch=@repo_info.branch/view?branch=@repo_info.branch)
|
||||
</pre>
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user