Skip to content

voronianski/hapi-micro-search-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Micro Search Engine

build status

The task was to implement a simple search API which accepts a word list and enables the searching of words in that list that start with a specified string.

The program you write is a small HTTP server which exposes the following two endpoints:

Dictionary

POST /dictionary

The dictionary of words to search through.

Input: JSON containing an array of words, e.g. ["foo", "bar", ...]

Output: Return an HTTP 200 status for valid data.

Search

GET /search/:string

All words that start with :string - e.g. /search/foo should return all words in the supplied dictionary starting with foo, including foo itself.

Input: the string, specified in the URL.

Output: A JSON array of words in the dictionary which start with the specified string, all in lower case. Should return an HTTP 200 status for valid data, even if no words are found (just return an empty JSON array in this case).

About

Micro search engine demo built with Hapi.js

Resources

Stars

Watchers

Forks

Packages

No packages published