Skip to content
πŸ¦€ Example implementation of fakedata_generator as a webserver 🌍
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.dockerignore
.gitignore
Cargo.lock
Cargo.toml
Dockerfile
LICENSE
README.md

README.md

fakedata_server

Usage example for fakedata_generator

Table of Contents

About

⬆️ Back to Top

fakedata_server is a showcase API implementing "fakedata_generator as a service". It provides an "API" that can return random data (one entry at a time) for GET requests.

Usage

⬆️ Back to Top

Rust

You can start the server with Rust by executing the following command.

$ cargo run

Docker

There is a Docker image available at https://hub.docker.com/r/kevingimbel/fakedata_server.

You can start the fakedata_server with the following command.

$ docker run -it --rm -p 8000:8000 kevingimbel/fakedata_server

The container cannot be exited with CTRL-C, see Known issues.

Accessing the API

After starting the server in either of the two ways listed above, you can access http://localhost:8000/. The / is required, see Known issues.

$ curl localhost:8000/gen/corpora/cat
$ curl localhost:8000/gen/username
$ curl localhost:8000/gen/domain 

Known issues

⬆️ Back to Top

  • For some reason the index route binds to localhost:8000/ with a / at the end but not to localhost:8000 (no /).

  • The Docker Container does not exit when pressing CTRL-C. When executed with -it you can press CTRL-P and CTRL-Q to detach from the container and then stop it with docker stop.

License

⬆️ Back to Top

MIT License Copyright (c) 2019 Kevin Gimbel

You can’t perform that action at this time.