1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

user modules + v install from vpm

This commit is contained in:
Alexander Medvednikov
2019-08-01 01:34:28 +02:00
parent d3c89273e8
commit a7e464fee9
5 changed files with 103 additions and 32 deletions

View File

@@ -483,6 +483,9 @@ pub fn ext(path string) string {
// dir returns all but the last element of path, typically the path's directory.
pub fn dir(path string) string {
if path == '.' {
return getwd()
}
mut pos := -1
// TODO PathSeparator defined in os_win.v doesn't work when building V,
// because v.c is generated for a nix system.

View File

@@ -32,7 +32,6 @@ pub fn (ctx Context) json(s string) {
ctx.conn.write('HTTP/1.1 200 OK
Content-Type: application/json
$h
$s
')
}
@@ -71,6 +70,7 @@ $html
}
pub fn run<T>(port int) {
println('Running vweb app on http://localhost:$port ...')
l := net.listen(port) or { panic('failed to listen') return }
for {
conn := l.accept() or {