GithubHelp home page GithubHelp logo

gilbertobotaro / n-odata-server-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from htammen/n-odata-server-example

0.0 1.0 0.0 64 KB

Example project for the n-odata-server

Dockerfile 3.41% HTML 11.73% JavaScript 65.51% TypeScript 19.36%

n-odata-server-example's Introduction

node_odata_server_example

#The node OData server for the loopback framework example project

This is an example project for the n-odata-server. It assumes that you have cloned the n-odata-server loopback component from github into a local folder named n-odata-server that is at the same hierarchy level as this project. If you cloned n-odata-server into another directory adjust the file package.json in this directory accordingly.

After you cloned this repository and the n-odata-server repository run npm install and then node . to start the application.

Sample Data

Create Sample Data

We have created a mechanism to produce the data you can work with from scratch. This is useful if you played around with the data and it got out of control. To initialize the data just call the index page and follow the instructions there.

If you want to edit the data or add some data for initalization go to the folder storage/sampledata. There you find some JSON files that you can edit. After you have edited a file go back to the initialize data link and initialize the data of the table you altered there. You don't have to restart the server for that.

Retrieve Sample Data

The index page also provides some links you can use to retrieve the data via the odata server. To test the odata server we recommend to use a browser plugin e.g. Postman. Here are some sample GET requests:

  • http://<host>:3000/odata/Customers?$expand=contacts
  • http://<host>:3000/odata/$metadata
  • http://<host>:3000/odata/People

Authentication and Authorization

n-odata-server leverages the authentication and authorization mechanisms supplied by loopback. We have provided a wiki page to help you get started easily with this topic.

Docker

It's also quite easy to run the application in a Docker container. This might be a good idea if you e.g. don't have a local node.js installation yet. To create a Docker container after pulling the github repo to your local pc just enter the following commands in a terminal window.

  • cd <folder of your git workspace>
  • docker build -t node-odata-server-example . depending on if you already downloaded the node docker image or not this may take a while
  • docker run -it -p 3000:3000 --name my-running-nodata-server node-odata-server-example

Then you can acces the application in your browser by entering: http://<host of your Docker VM>:3000/ You should now see the simple Homepage of the application

To get the ip address of your Docker VM just enter docker-machine ls and pull out the ip address of the URL column of the machine default. E.g.:

NAME      ACTIVE   DRIVER       STATE     URL                         SWARM   DOCKER    ERRORS
bluemix   -        virtualbox   Running   tcp://192.168.99.102:2376           v1.10.0
default   *        virtualbox   Running   tcp://192.168.99.100:2376           v1.10.0

n-odata-server-example's People

Contributors

htammen avatar jhamel avatar

Watchers

Gilberto Botaro 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.