aboutsummaryrefslogtreecommitdiff
path: root/examples/webserver.sloth
diff options
context:
space:
mode:
authorCody <cody@codyq.dev>2023-06-26 23:53:44 -0500
committerCody <cody@codyq.dev>2023-06-26 23:53:44 -0500
commit9748e95027af7820e6d9f08eb20b0901fdedfa2a (patch)
tree248fd1952537edc9e107110a6dc5a432c676d021 /examples/webserver.sloth
parent27b7187c21f6ff4e469592a8ea5757ca6aee8577 (diff)
downloadsloth-9748e95027af7820e6d9f08eb20b0901fdedfa2a.tar.gz
Delete random examples
Diffstat (limited to 'examples/webserver.sloth')
-rw-r--r--examples/webserver.sloth108
1 files changed, 0 insertions, 108 deletions
diff --git a/examples/webserver.sloth b/examples/webserver.sloth
deleted file mode 100644
index abbead3..0000000
--- a/examples/webserver.sloth
+++ /dev/null
@@ -1,108 +0,0 @@
-# Include the external dependency itself as a module named "slow_api"
-use extern "slowapi" as slow_api;
-
-# Use some things from the "slow_api" module
-use std::serde::Serializable;
-use std::serde::format::Json;
-
-use slow_api::{SlowAPI, Method};
-
-# Construct a slow API server
-val server = SlowApi();
-
-type Person derives Serializable = {
- name: String,
- age: Option<String>
-};
-
-fn hello_route(
- name: Argument<String>,
- age: Argument<Option<String>>,
-) -> Json<Person> {
- Person { name, age }
-}
-
-# Start the server
-server
- .route(Method::GET, "/hello", hello_route)
- .start("0.0.0.0:8000");
-#
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-###
-type Poggies;
-
-trait Constructor<..T> {
- fn new(..T) -> Self;
-}
-
-impl Constructor<> for Poggies {
- fn new() -> Self {
- #
- }
-}
-
-impl<T: Constructor<>> Default for T {
- fn default() -> Self {
- Self::new()
- }
-}
-
-###
-type Person = {
- name: String,
- age: i32,
-};
-
-type Person derives Serialize, Deserialize = {
- name: String,
- age: i32,
-};
-
-@route::get("/teacup") # vvvvvv - Requires T to implement Serialize
-fn teacup_route() -> Response<Person> {
- Response(418, Person {
- name: "Cody Q",
- age: 17,
- })
-}