GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - wizardone/parser: Parsing urls against a set of rules.

BranchesTags
Open more actions menu

Latest commit

 

History

20 Commits
20 Commits

Folders and files

NameName
Last commit message
Last commit date
config
config
 
 
lib
lib
 
 
test
test
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
README.md
README.md
 
 
mix.exs
mix.exs
 
 

Repository files navigation

UrlParser

Build Status

A small service that parses the whole request body (currently it is working only with the query params), it is meant to run the whole request against a set of rules (as anonymous functions) and determine where to redirect the request body. This is my first ever elixir project, so I intent to extend it more and make it more usable.

Usage

# Start the process, that will hold the rules
UrlParser.Rule.start_agent

# Add some rules
function = fn(request) -> String.match?(request, ~r/query/) end
UrlParser.Rule.add(:query, function)

uri = "http://test.com/?query=omg"
# If the url satisfies the rule
UrlParser.parse(uri)
=> [ok: :query]

# If the url does not satisfy the rule.
UrlParser.parse(uri)
=> [{:not_ok, "Rules do not match"}]

Installation

If available in Hex, the package can be installed as:

  1. Add url_parser to your list of dependencies in mix.exs:
```elixir
def deps do
  [{:url_parser, "~> 0.1.0"}]
end
```
  1. Ensure url_parser is started before your application:
```elixir
def application do
  [applications: [:url_parser]]
end
```

About

Parsing urls against a set of rules.

Topics

elixirmixparsingrules

Resources

Readme
Activity

Stars

3 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.