npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

n-odata-server-example

v0.0.1

Published

hello-world

Downloads

3

Readme

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

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