Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,12 @@ test:

clear_cache:
python manage.py clear_cache

docker-build:
docker build -t swapi .

docker-run:
docker run -p8000:8000 --name swapi-local-container --rm swapi

docker-kill:
docker kill swapi-local-container
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,20 @@ An "unofficial" branch of "swapi", supported by @juriy


## Will it be updated?
Original swapi project is built on Python/Django stack that is quite outdated by now. It would be a great exercise to rewrite it in cloud-native manner, but this requires time and effort. I'm looking into doing that. There's no timelines yet, since "swapi" stopped its existence quite suddenly. Suggestions and help are always welcome!

Original swapi project is built on Python/Django stack that is quite outdated by now.
It would be a great exercise to rewrite it in cloud-native manner, but this requires time and effort. I'm looking into doing that. There's no timelines yet, since "swapi" stopped its existence quite suddenly. Suggestions and help are always welcome!

## How to run it?
The easiest way to run swapi – via docker

```
# Ruilding the image
make docker-build

# Running the container
make docker-run

# Kill the running container
make docker-kill
```
5 changes: 5 additions & 0 deletions swapi/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
<link href="/static/css/bootstrap.css" rel="stylesheet">
<link href="/static/css/custom.css" rel="stylesheet">
<link rel="shortcut icon" href="/static/favicon.ico">
<!-- highlight.js -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css">
</style>
<script src="//code.jquery.com/jquery-2.1.0.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
Expand All @@ -22,6 +24,9 @@
gtag('js', new Date());
gtag('config', 'UA-163610532-1');
</script>
<!-- Highlight.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
<script>hljs.highlightAll();</script>
</head>
<body>
<nav class="navbar navbar-default" role="navigation">
Expand Down
6 changes: 3 additions & 3 deletions swapi/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ <h1 class="center">
<span class="input-group-btn"><button onClick="interactive_call();return false;" class="btn btn-primary">request</button></span>
</div>
<small>Need a hint? try <a href="#" onClick="update('people/1/');return false;"><i>people/1/</i></a> or <a href="#" onClick="update('planets/3/');return false;"><i>planets/3/</i></a> or <a href="#" onClick="update('starships/9/');return false;"><i>starships/9/</i></a></small>
<p class="lead pad_top">Result:</p>
<p class="lead pad_top">Results:</p>
<div class="well">
<pre id="interactive_output" class="pre-scrollable">
<pre id="interactive_output" class="pre-scrollable"><code class="language-json">
{
"name": "Luke Skywalker",
"height": "172",
Expand Down Expand Up @@ -63,7 +63,7 @@ <h1 class="center">
"edited": "2014-12-20T21:17:56.891000Z",
"url": "https://swapi.dev/api/people/1/"
}
</pre>
</code></pre>
</div>
</div>
<div class="col-sm-2 col-lg-2 col-md-2">
Expand Down