vweb: required features

Created on 12 Aug 2019  路  7Comments  路  Source: vlang/v

Some required (basic) features of vweb module, please reply below for features not listed here.

  • [ ] Routing

    • [ ] Variable Rules. e.g. /post/<int:post_id>. At least string, int should be supported, additionally, float, path, uuid and more.

    • [ ] Able to define allowed http method(s) (get/post/put/delete) for the url. e.g. in Python Flask: @app.route('/login', methods=['GET', 'POST'])

  • [ ] Access http GET/POST/PUT data
  • [ ] Able to specify directories for

    • [ ] Template files

    • [ ] Static files

  • [ ] Able to custom 404/500/502/... error pages
  • [ ] Cookie/session support.
  • [ ] File uploading support

Template Engine

Syntax like Python Jinja2 is popular nowadays, if vweb template engine is fully compatible, that would be very easy for web developers to migrate from Jinja2 style template (including Django) to vweb - rewriting all existing html template files in a big project is too much work and pain.

  • [ ] template inheritance
  • [ ] localization/internationalization
  • [ ] Offer some builtin filters
  • [ ] Able to add custom filters
Feature Request

Most helpful comment

Anyone interested in the most recent vweb changes should check the gitly source: https://github.com/vlang/gitly

For redirects on the server side, you just use vweb.redirect().

To specify http methods, use attributes [get], [post], etc.

If the route contains pieces starting with :, these are passed as variables into your function, like so:

[post]
['/:user/:repo/settings']
pub fn (mut app App) update_repo_settings(user, repo string) vweb.Result {

All 7 comments

make a request.

  • Request forward.
  • Support uploading files.
  • Security in any request.
  • Request forward.
  • Support uploading files.
  • Security in any request.

I added File uploading support. Thanks for sharing.
It would be better to explain with more details of other 2 features so that others can easily understand what they're.

Hi @iredmail , Sorry for confusing you, maybe I have a problem in my words.

Request forward.

This is redirecting a request. When I'm in /profile page, I can redirect /login page. I think vweb should have this ability.

Security in any request.

This is a commonly base concept.

When user upload a image, vweb should validate the image's security simply(fg check the file's header...).

Or if I have a uri like /user/\, and I request the /user/'';select * from xxx;. This maybe occur a sql injection problem. So I think vweb also should validate it.

Hi all, for redirect I think it's redirect from clients, right ?
Even forward (redirect to another URL at server side) could be useful too ...

On uploads, to avoid attacks and other stuff, please set a default buffer dimension and the ability to override it if needed.

Adding to the routing->Rules, i'd like to see a way to make files without extensions show up (+ define custom mime types without editing vweb.v)

Anyone interested in the most recent vweb changes should check the gitly source: https://github.com/vlang/gitly

For redirects on the server side, you just use vweb.redirect().

To specify http methods, use attributes [get], [post], etc.

If the route contains pieces starting with :, these are passed as variables into your function, like so:

[post]
['/:user/:repo/settings']
pub fn (mut app App) update_repo_settings(user, repo string) vweb.Result {
Was this page helpful?
0 / 5 - 0 ratings

Related issues

arg2das picture arg2das  路  3Comments

oleg-kachan picture oleg-kachan  路  3Comments

elimisteve picture elimisteve  路  3Comments

choleraehyq picture choleraehyq  路  3Comments

aurora picture aurora  路  3Comments