Skip to content

Commit

Permalink
Merge pull request #109 from wesen/task/add-json-post-body-middleware
Browse files Browse the repository at this point in the history
Add comprehensive form and JSON parameter parsing middleware
  • Loading branch information
wesen authored Feb 15, 2025
2 parents f61fd8c + e771aab commit f1de228
Show file tree
Hide file tree
Showing 11 changed files with 1,459 additions and 36 deletions.
25 changes: 25 additions & 0 deletions pkg/doc/topics/01-parka-server.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
---
Title: Parka Server
Slug: parka-server
Short: Learn about the core concepts of the Parka server, its configuration options, and how to extend it with custom routes and middleware
Topics:
- server
- configuration
- routing
- middleware
- web server
Commands:
- NewServer
- Run
Flags:
- WithPort
- WithAddress
- WithGzip
- WithDefaultParkaRenderer
- WithDefaultParkaStaticPaths
IsTopLevel: true
IsTemplate: false
ShowPerDefault: true
SectionType: GeneralTopic
---

# Parka Server Documentation

The Parka server is a flexible HTTP server built on top of the Echo web framework that provides both static file serving and dynamic template rendering capabilities. This document explains how the server works and how to extend it.
Expand Down
28 changes: 28 additions & 0 deletions pkg/doc/topics/02-handlers.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
---
Title: Parka Handlers Documentation
Slug: handlers
Short: Learn about Parka's specialized handlers for serving static content, templates, and commands
Topics:
- handlers
- static files
- templates
- commands
- web server
Commands:
- NewStaticDirHandler
- NewStaticFileHandler
- NewTemplateHandler
- NewTemplateDirHandler
- NewCommandHandler
- NewCommandDirHandler
Flags:
- WithDefaultFS
- WithLocalPath
- WithTemplateName
- WithDevMode
IsTopLevel: true
IsTemplate: false
ShowPerDefault: true
SectionType: GeneralTopic
---

# Parka Static Handlers Documentation

Parka provides two specialized handlers for serving static content: `StaticDirHandler` and `StaticFileHandler`. These handlers are designed to serve static files from either the filesystem or embedded files, with different strategies for path handling and file organization.
Expand Down
27 changes: 27 additions & 0 deletions pkg/doc/topics/03-parka-tutorial.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
---
Title: Building a Parka Server Tutorial
Slug: parka-tutorial
Short: A comprehensive tutorial on building a Parka server from scratch, covering basic setup to advanced features
Topics:
- tutorial
- server
- handlers
- templates
- commands
- web development
Commands:
- NewServer
- NewStaticDirHandler
- NewTemplateHandler
- NewCommandHandler
Flags:
- WithPort
- WithAddress
- WithGzip
- WithLocalPath
IsTopLevel: true
IsTemplate: false
ShowPerDefault: true
SectionType: Tutorial
---

# Building a Parka Server: A Comprehensive Tutorial

This tutorial will guide you through building a Parka server from scratch, covering everything from basic setup to advanced features. We'll create a complete application that demonstrates the various capabilities of Parka.
Expand Down
23 changes: 23 additions & 0 deletions pkg/doc/topics/04-config-file.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
---
Title: Configuring Parka Servers with Config Files
Slug: config-file
Short: Learn how to configure Parka servers using YAML configuration files to define routes, handlers, and their settings
Topics:
- configuration
- yaml
- routes
- handlers
- server
Commands:
- NewConfigFileHandler
- ParseConfig
Flags:
- WithDevMode
- WithRepositoryFactory
- WithAppendCommandDirHandlerOptions
IsTopLevel: true
IsTemplate: false
ShowPerDefault: true
SectionType: GeneralTopic
---

# Configuring Parka Servers with Config Files

Parka servers can be configured using YAML configuration files that define routes, handlers, and their settings. This document explains how to use config files to set up your Parka server, with a focus on integrating Glazed commands and other handlers.
Expand Down
27 changes: 27 additions & 0 deletions pkg/doc/topics/05-templates-and-rendering.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
---
Title: Template Rendering in Parka
Slug: template-rendering
Short: Learn about Parka's flexible template rendering system for HTML and Markdown templates with features like template lookup, reloading, and directory-based serving
Topics:
- templates
- rendering
- html
- markdown
- web server
Commands:
- NewLookupTemplateFromFile
- NewLookupTemplateFromDirectory
- NewLookupTemplateFromFS
- NewRenderer
Flags:
- WithFS
- WithBaseDir
- WithPatterns
- WithAlwaysReload
- WithMarkdownBaseTemplateName
IsTopLevel: true
IsTemplate: false
ShowPerDefault: true
SectionType: GeneralTopic
---

# Template Rendering in Parka

Parka provides a flexible and powerful template rendering system that supports both HTML and Markdown templates, with features like template lookup, reloading, and directory-based serving. This document explains how the template system works and how to use it effectively.
Expand Down
27 changes: 27 additions & 0 deletions pkg/doc/topics/06-command-handlers.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
---
Title: Command Handler Parameter Filtering
Slug: command-handler-parameter-filtering
Short: Learn how to configure and use parameter filtering in Parka command handlers to control parameter handling, defaults, overrides, and filtering
Topics:
- handlers
- commands
- parameter filtering
- configuration
Commands:
- NewParameterFilter
- WithOverrideParameter
- WithDefaultParameter
- WithWhitelistParameters
- WithBlacklistParameters
Flags:
- WithParameterFilter
- WithOverrides
- WithDefaults
- WithWhitelist
- WithBlacklist
IsTopLevel: true
IsTemplate: false
ShowPerDefault: true
SectionType: GeneralTopic
---

# Command Handler Parameter Filtering

This document describes the parameter filtering options available for command handlers in Parka. These options allow you to control how parameters are handled, including setting defaults, overrides, and filtering which parameters are exposed.
Expand Down
Loading

0 comments on commit f1de228

Please sign in to comment.