• Stars
    star
    326
  • Rank 124,887 (Top 3 %)
  • Language V
  • License
    MIT License
  • Created over 4 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Easy-to-use, modular web framework built for V

Logo

Easy-to-use, modular web framework for V.

CI

Example written on VEX

module main

import nedpals.vex.router
import nedpals.vex.server
import nedpals.vex.ctx

fn print_req_info(mut req ctx.Req, mut res ctx.Resp) {
	println('${req.method} ${req.path}')
}

fn do_stuff(mut req ctx.Req, mut res ctx.Resp) {
	println('incoming request!')
}

fn main() {
    mut app := router.new()
    app.use(do_stuff, print_req_info)

    app.route(.get, '/', fn (req &ctx.Req, mut res ctx.Resp) {
        res.send_file('index.html', 200)
    })

    app.route(.get, '/public/*path', fn (req &ctx.Req, mut res ctx.Resp) {
        res.send_file('public/' + req.params['path'], 200)
    })

    app.route(.get, '/path/:name', fn (req &ctx.Req, mut res ctx.Resp) {
        println('path is ${req.params["name"]}')
    }, fn (req &ctx.Req, mut res ctx.Resp) {
        res.send('path: ' + req.params['name'], 200)
    })

    app.route(.get, '/complex/:name/*path', fn (req &ctx.Req, mut res ctx.Resp) {
        res.send('username: ' + req.params['name'] + '\npath: ' + req.params['path'], 200)
    })

    server.serve(app, 6789)
}

Installation & Getting Started

Learn how to setup and use VEX by reading the Wiki.

Roadmap

  • Support for GET, POST, PUT, PATCH, DELETE, and OPTION HTTP methods.
  • HTTP Router (Wildcards are now supported)
  • Route groups (non-reusable for now)
  • Static file server
  • Params and query parsing
  • Middleware support
  • Cookie parsing (basic support)
  • Cookie manipulation / Session support
  • Websocket Server
  • Body parsing
    • application/x-www-form-urlencoded support
    • application/json support
    • multipart/form-data support

Contributing

  1. Fork it (https://github.com/nedpals/vex/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Examples

Examples can be found at the /examples directory.

License

MIT

Contributors

More Repositories

1

supabase-go

Unofficial Supabase client library for Go.
Go
221
star
2

sharn

Managing shards made easier.
Crystal
39
star
3

vargs

Simple argument parsing library for V.
V
39
star
4

v-jsonrpc

Basic JSON-RPC 2.0-compliant server written on V.
V
32
star
5

tree-sitter-v

Tree-sitter parser for V
C
24
star
6

v-mime

MIME Library for V.
V
22
star
7

jisoni

A native JSON parser written in pure @vlang/v
V
13
star
8

myuic-neo

An unofficial, third-party student portal website for students of the University of the Immaculate Conception (UIC).
Vue
12
star
9

bliss

Experimental code analyzer for V using tree-sitter
TypeScript
10
star
10

lsp.v

Implementation of the Language Server Protocol spec on V for nedpals/vls
V
9
star
11

vls2

V language server rewritten from scratch
V
9
star
12

kuman

Simple, Express-style CLI framework for Node.
TypeScript
9
star
13

intellij-vlang

The soon-to-be-official plugin of V language for IntelliJ
Kotlin
9
star
14

mangavue

Manga reader powered by Vue.
CSS
5
star
15

riz

Static site generator powered by Mithril and Parcel.
JavaScript
4
star
16

m-dex

Library for parsing Mangadex.org data. Written on Crystal.
Crystal
4
star
17

k12-shs-api

API for List of Senior High Schools grabbed from DepEd.
Ruby
3
star
18

sulatcms

Super simple platform-agnostic headless CMS
JavaScript
3
star
19

flames-bot

🔥 Predict your future relationship with other people. For Discord Hack Week 2019.
JavaScript
2
star
20

postgrest-go

Go
2
star
21

ast2

V
1
star
22

pocketwitter

JavaScript
1
star
23

ojt-recorder

TypeScript
1
star
24

errgoengine

Contextualized programming error analysis translation engine
Go
1
star
25

cc131_notes

codes and notes from cc131
Java
1
star