Git Product home page Git Product logo

angularjs-oscars's Introduction

angularjs-oscars

A simple search application built completely with AngularJS on NoSQL MarkLogic database

oscars

Setup
  1. Install free developer version of MarkLogic
  2. Go to AppBuilder at http://localhost:8000/appservices
  3. Give name for the app, say Oscars, give name for database, say Oscar-DB.
  4. Follow through the setup wizard with default settings and deploy the app on default port (5275) or give different port, say 8003
  5. This essentially deploys the application on REST server attached to Oscars-DB containing 9 documents
  6. Git clone this repo
  7. cd angularjs-oscars
  8. npm install
  9. npm start
To enable CORS

Option 1: Add this piece of code in search-list-query.xqy available at /Users/<username>/Library/MarkLogic/Modules/MarkLogic/rest-api/endpoints dir for GET and POST. This is important for the server to handle requests from the app

replace

    return  if (exists($response)) then $response

with

    return
    if (exists($response)) then 	
    (eput:add-response-header("Access-Control-Allow-Origin", xdmp:get-request-header('Origin')), 	
      eput:add-response-header("Access-Control-Allow-Credentials","true"), 
    $response)

Option 2: Set up a proxy server using expressjs or http-proxy or any other proxy server that essentially helps you enable CORS

angularjs-oscars's People

Contributors

csreddy avatar

Stargazers

Larry Chen avatar Mehdi Maachou avatar Mike Wooldridge avatar

Watchers

James Cloos avatar  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.