Start Javascript regex for validating url

Javascript regex for validating url

Let's say we want a list of users with the last two posts: http GET :8080/api/users fields='id,name,posts(limit:2)' HTTP/1.1 201 Created Content-Length: 155 Content-Location: /api/users/ar6ejgmkj5lfl98r67p0 Content-Type: application/json Date: Mon, GMT Etag: "1e18e148e1ff3ecdaae5ec03ac74e0e4" Last-Modified: Mon, GMT Vary: Origin [ ] Sub-requests are executed concurrently whenever possible to ensure the fastest response time.

It's doesn't seem useful in this example, but with fields parameters, it becomes very powerful (see below).

Aliasing works with sub-fields as well: Field parameters are used to apply a transformation on the value of a field using custom logic.

But each time fields are added, all existing API clients automatically gets the additional cost.

This tend to lead to huge wast of bandwidth and added latency due to the transfer of unnecessary data.

match \n (default false)U ungreedy: swap meaning of x REST APIs tend to grow over time.

Resources get more and more fields to fulfill the needs for new features.

A sub-resource is automatically filtered by it's parent on the field specified as second argument of the posts := index. More precisely, it is the syntax accepted by RE2 and described at https://golang.org/s/re2syntax, except for \C.

Flags are supported for more control over regular expressions.

Thanks to its advanced field selection syntax or Graph QL support, you can gather resources and their dependencies in a single request, saving you from costly network roundtrips.

The REST Layer framework is composed of several sub-packages: package main import ( "log" "net/http" "github.com/rs/rest-layer-mem" "github.com/rs/rest-layer/resource" "github.com/rs/rest-layer/rest" "github.com/rs/rest-layer/schema" ) var ( // Define a user resource schema user = schema.

For instance, if you are using an on demand dynamic image resizer, you may want to expose the capability of this service, without requiring from the client to learn another URL based API.