All Projects → nblackburn → micro-match

nblackburn / micro-match

Licence: MIT License
A micro library for matching urls.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to micro-match

miki
Wiki system in PHP+NoDB in just one file. 10s setup + auto-installed. Full Markdown support. Super fast and lightweight (-0.01MB gzip). Multi-User support. Minimal and beautiful.
Stars: ✭ 25 (-30.56%)
Mutual labels:  micro
microauth
Collection of authentication modules for ▲zeit's micro.
Stars: ✭ 71 (+97.22%)
Mutual labels:  micro
piranha
Piranha - a modern cloud runtime
Stars: ✭ 136 (+277.78%)
Mutual labels:  micro
micro-next
Integrations between Micro and Next.js
Stars: ✭ 20 (-44.44%)
Mutual labels:  micro
Micro
Micro is coming back!
Stars: ✭ 11 (-69.44%)
Mutual labels:  micro
phalcon-micro-rest-api-skeleton
This is a basic API REST skeleton written on Phalcon PHP. Great For building an MVP for your frontend app (Vue, react, angular, or anything that can consume an API)
Stars: ✭ 57 (+58.33%)
Mutual labels:  micro
micro-starter
Micro 微服务实践
Stars: ✭ 391 (+986.11%)
Mutual labels:  micro
micro-redirect
A tiny Node.js microservice to redirect users to a different location.
Stars: ✭ 16 (-55.56%)
Mutual labels:  micro
hooked
Microservice for communicating between Contentful and Shopify
Stars: ✭ 17 (-52.78%)
Mutual labels:  micro
criterion
statistics-driven micro-benchmarking framework
Stars: ✭ 17 (-52.78%)
Mutual labels:  micro
micro-swagger
Swagger generate and Swagger web server. It's redefined document for coder.
Stars: ✭ 34 (-5.56%)
Mutual labels:  micro
micro-airtable-api
Quickly make an API from Airtable
Stars: ✭ 30 (-16.67%)
Mutual labels:  micro
micro-joi
A Joi wrapper for zeit/micro
Stars: ✭ 46 (+27.78%)
Mutual labels:  micro
micro-visualize
Visualizes requests and responses for services written with micro
Stars: ✭ 55 (+52.78%)
Mutual labels:  micro
elixir-ms
an elixir microservice base/skeleton 💀
Stars: ✭ 39 (+8.33%)
Mutual labels:  micro
micro-chain
🤝 Helps to build chains from your micro services.
Stars: ✭ 24 (-33.33%)
Mutual labels:  micro
micro-plugins
go-micro plugins, auth(JWT+Casbin)、go-micro服务加入istio服务网格
Stars: ✭ 27 (-25%)
Mutual labels:  micro
micro-code-analyser
A tiny Node.js microservice to detect the language of a code snippet
Stars: ✭ 21 (-41.67%)
Mutual labels:  micro
micro
A simple tool kit for building microservices.
Stars: ✭ 15 (-58.33%)
Mutual labels:  micro
HIGH-TO-LOW
in this repository you will find codes in C and their equivalence in MIPS Assembly
Stars: ✭ 20 (-44.44%)
Mutual labels:  micro

micro match

A simple url matching utility for micro.

Installation

To install micro match, simply run the following command in your terminal of choice.

npm install -g micro-match

Once you have installed micro match, simply include it in your project like so...

const { match, test } = require('micro-match');

Usage

Match

The match method allows you to match a route binding to it's real world counterpart and return it's bindings.

const {id} = match('/users/:id', '/users/1');

Parameters are defined as a comma followed by an alias to bind it's value to.

You can also create optional parameters by attaching a ? suffix. This will allow both /users and /users/1 to be matched.

Now you will be able to access the id parameter with the value of 1 and handle it however ever you like.

Test

The test method allows you check if the pattern matches the given url.

test('/users/:id', '/users/1');

Changes

Details for each release are documented in the release notes.

License

This utility is licensed under MIT, see LICENSE.md for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].