Index

joshstock.in / 009440a

Source for serving and static templating/compiling of https://joshstock.in.

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
9612 Dec 2020 20:23009440aUpdate lua-gitwebJosh Stockin1230G

Blob @ joshstock.in / lua-gitweb / utils / parse_uri.lua

text/plain399 bytesdownload raw
1-- parse_uri.lua
2-- URI parsing
3
4-- Copyright (c) 2020 Joshua 'joshuas3' Stockin
5-- <https://joshstock.in>
6
7local utils = require("utils/utils")
8
9local _M = {}
10
11_M.parse_uri = function()
12 local uri = ngx.var.uri
13 local split = string.split(string.sub(uri,2),"/")
14
15 local parsed = {}
16 parsed.uri = uri
17 parsed.parts = split
18 parsed.repo = split[1]
19
20 return parsed
21end
22
23return _M
24