Skip to content

Adview manager serve ads preview #564

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 16 commits into
base: aip-61-adex-v5
Choose a base branch
from
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
195 changes: 174 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ members = [
"validator_worker",
"sentry",
"test_harness",
# for mocking calls to the platform
"test_harness/platform",
]
16 changes: 14 additions & 2 deletions adview-manager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ a publisher websites.

Running the local server:

`RUST_LOG=debug cargo run -p serve`
`RUST_LOG=debug cargo run -p adview-serve`

This will start a server at `127.0.0.1:3030`

Expand All @@ -21,4 +21,16 @@ for the server.

Routes:

- `GET /ad` - visualizes a single ad
- `GET /` - landing page
- `GET /preview` - preview form for submitting a single AdSlot response from `platform` and see the result
- `POST /preview` - preview of a single AdSlot Image example
- `GET /preview/ad` - preview a single example ad
- `GET /preview/video` - preview a single Video example ad


### POST `/preview`

You need to be running:
- `sentry` Leader at 8005
- `sentry` Follower at 8006
- Mock [`Platform`](../test_harness/platform) at 8004
25 changes: 21 additions & 4 deletions adview-manager/serve/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,21 @@ publish = false
# Domain
adex_primitives = { version = "0.2.0", path = "../../primitives", package = "primitives", features = ["test-util"] }
adview-manager = { path = "../" }

# Application errors
anyhow = "1"
# Time
chrono = "0.4"

# Making requests to the Mocked Platform
reqwest = { version = "0.11", features = ["json"] }

# Async runtime
tokio = { version = "1", features = ["macros", "time", "rt-multi-thread"] }

# Web Server
axum = "0.5"
axum = { version = "0.5", features = ["headers", "macros"] }
axum-extra = { version = "0.3", features = ["form"] }

# Template engine
tera = { version = "1" }
Expand All @@ -28,7 +36,16 @@ wiremock = { version = "0.5" }

# (De)Serialization
serde = { version = "^1.0", features = ["derive"] }
serde_json = "1"

# For env. variable deserialization for Config
envy = "0.4"

# Tracing
tracing = { version = "0.1", features = ["log"] }
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }

once_cell = "1"

# Logging
log = "0.4"
env_logger = { version = "0.9" }
[dev-dependencies]
pretty_assertions = "1"
Loading