Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
* Static Content API - see {@link io.avaje.jex.staticcontent.StaticContentService}.
*
* <pre>{@code
* var staticContent = StaticContentService.createCP("/public").directoryIndex("index.html");
* var staticContent = StaticContentService.createCP("/public").httpPath("/").directoryIndex("index.html");
* final Jex.Server app = Jex.create()
* .routing(staticContent.createService())
* .routing(staticContent)
* .port(8080)
* .start();
*
Expand Down
4 changes: 2 additions & 2 deletions avaje-jex-static-content/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
* Defines the Static Content API for serving static resources with Jex - see {@link io.avaje.jex.staticcontent.StaticContentService}.
*
* <pre>{@code
* var staticContent = StaticContentService.createCP("/public").directoryIndex("index.html");
* var staticContent = StaticContentService.createCP("/public").httpPath("/").directoryIndex("index.html");
* final Jex.Server app = Jex.create()
* .routing(staticContent.createService())
* .routing(staticContent)
* .port(8080)
* .start();
*
Expand Down
16 changes: 8 additions & 8 deletions avaje-jex/src/main/java/io/avaje/jex/Context.java
Original file line number Diff line number Diff line change
Expand Up @@ -246,54 +246,54 @@ default String userAgent() {
int status();

/** Write plain text content to the response. */
Context text(String content);
void text(String content);

/** Write html content to the response. */
Context html(String content);
void html(String content);

/**
* Set the content type as application/json and write the response.
*
* @param bean the object to serialize and write
*/
Context json(Object bean);
void json(Object bean);

/**
* Write the stream as a JSON stream with new line delimiters {@literal
* application/x-json-stream}.
*
* @param stream The stream of beans to write as json
*/
<E> Context jsonStream(Stream<E> stream);
<E> void jsonStream(Stream<E> stream);

/**
* Write the stream as a JSON stream with new line delimiters {@literal
* application/x-json-stream}.
*
* @param iterator The iterator of beans to write as json
*/
<E> Context jsonStream(Iterator<E> iterator);
<E> void jsonStream(Iterator<E> iterator);

/**
* Writes the given string content directly to the response.
*
* @param content The string content to write.
*/
Context write(String content);
void write(String content);

/**
* Writes the given bytes directly to the response.
*
* @param bytes The byte array to write.
*/
Context write(byte[] bytes);
void write(byte[] bytes);

/**
* Writes the content from the given InputStream directly to the response body.
*
* @param is The input stream containing the content to write.
*/
Context write(InputStream is);
void write(InputStream is);

/**
* Return the outputStream to write content. It is expected that
Expand Down
Loading