Skip to content

Commit

Permalink
cleanup: fix Markdown syntax and eol
Browse files Browse the repository at this point in the history
Signed-off-by: K.B.Dharun Krishna <[email protected]>
  • Loading branch information
kbdharun committed Dec 19, 2023
1 parent a022188 commit 52e89a5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
25 changes: 21 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,45 @@
<hr />
</div>


## Features

- API based response
- Markdown support
- Search
- Localized
- Localization
- Git based and/or local articles storage
- Ristretto based cache (more cache backends coming soon)
- Multi-repository support

## Configuration

Edit the `config/chronos.json` file to configure the server.

## Run (dev)

```bash
go run main.go
```

## Build

```bash
go build -o chronos main.go
```

## Run (prod)

```bash
./chronos
```

## Repositories

Chronos supports multiple repositories, both local and Git based. This allows you
to have a single server for multiple projects or multiple repositories for a single project.

Repositories can be configured in the `chronos.json` file as follows:

```json
{
"port": "8080",
Expand All @@ -59,9 +66,11 @@ Each repository must have a unique `id`, Chronos requires it to identify the rep
when requesting articles.

### Local repositories

Each local repository must contain an `articles` folder with the following structure:
```
doumentation

```txt
documentation
├──articles
├─── en
│   └─── article1.md
Expand All @@ -70,10 +79,12 @@ doumentation
```

### Git repositories

You can use a Git repositories as well, just add them to the `GitRepos` array in the `chronos.json` file,
Chronos will automatically clone them and update on each restart.

### Background updates

In the current version, automatic updates are not supported.

## API Reference
Expand All @@ -85,6 +96,7 @@ Get the status of the server.
- **URL**: `http://localhost:8080/`
- **Method**: GET
- **Response**:

```json
{
"status": "ok"
Expand All @@ -96,6 +108,7 @@ Check if a repository is available.
- **URL**: `http://localhost:8080/{repoId}`
- **Method**: GET
- **Response**:

```json
{
"status": "ok"
Expand All @@ -109,6 +122,7 @@ Get a list of articles, grouped by language.
- **URL**: `http://localhost:8080/{repoId}/articles/{lang}`
- **Method**: GET
- **Response**:

```json
{
"title": "repoId",
Expand Down Expand Up @@ -143,6 +157,7 @@ Get a list of supported languages.
- **URL**: `http://localhost:8080/{repoId}/langs`
- **Method**: GET
- **Response**:

```json
{
"SupportedLang": ["en", "it"]
Expand All @@ -156,6 +171,7 @@ Get a specific article by providing its language and slug.
- **URL**: `http://localhost:8080/{repoId}/articles/en/test`
- **Method**: GET
- **Response**:

```json
{
"Title": "Test Article",
Expand All @@ -173,6 +189,7 @@ Search articles based on a query string.
- **URL**: `http://localhost:8080/{repoId}/search/{lang}?q=test`
- **Method**: GET
- **Response**:

```json
[
{
Expand Down

0 comments on commit 52e89a5

Please sign in to comment.