GithubHelp home page GithubHelp logo

neosin / flask-jssearchengine Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kevinyobeth/flask-jssearchengine

0.0 0.0 0.0 106 KB

Backend application for javascript snippet search engine.

Home Page: https://ir.kevinyobeth.com

Python 100.00%

flask-jssearchengine's Introduction

Javascript Snippet Search Engine - Documentation

1. Get Random Snippets

GET https://js-searchengine.herokuapp.com/

Description

Returns 5 random javascript snippet. Returns the ID and Title of the code snippet.

Parameters

none

Response

200 OK

Body

{
  "19": {
    "id": 19,
    "title": "allEqualBy"
  },
  "69": {
    "id": 69,
    "title": "converge"
  },
  "180": {
    "id": 180,
    "title": "httpDelete"
  },
  "280": {
    "id": 280,
    "title": "merge"
  },
  "435": {
    "id": 435,
    "title": "toSnakeCase"
  }
}

2. Search Snippet using TF-IDF

POST https://js-searchengine.herokuapp.com/search?query={query}

Description

Search javascript snippets from database with given query. Returns the ID and Title of the snippets

Parameters

query: String of query to search.

Response

200 OK

Body

{
  "117": {
    "id": 117,
    "title": "everyNth"
  },
  "191": {
    "id": 191,
    "title": "initial"
  },
  "310": {
    "id": 310,
    "title": "orderWith"
  },
  "327": {
    "id": 327,
    "title": "pluck"
  },
  "372": {
    "id": 372,
    "title": "sampleSize"
  },
  "381": {
    "id": 381,
    "title": "shuffle"
  },
  "410": {
    "id": 410,
    "title": "tail"
  },
  "449": {
    "id": 449,
    "title": "uniqueElements"
  },
  "90": {
    "id": 90,
    "title": "deepFlatten"
  }
}

Response

204 No Content

Body

{}

3. Get code by ID

GET https://js-searchengine.herokuapp.com/code/{id}

Description

Get the result of code ID. Returns the title, tags, description and the code itself.

Parameters

id: Code ID to find.

Response

200 OK

Body

{
  "code": "const all = (arr, fn = Boolean) => arr.every(fn);\nall([4, 2, 3], x => x > 1); // true\nall([1, 2, 3]); // true",
  "description": "all: Checks if the provided predicate function returns true for all elements in a collection.\n\nUse Array.prototype.every() to test if all elements in the collection return true based on fn.\nOmit the second argument, fn, to use Boolean as a default.",
  "tags": "array,beginner",
  "title": "all"
}

Response

204 No Content

Body

{}

flask-jssearchengine's People

Contributors

kevinyobeth avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.