/RESTful-Node

Getting Started with Node-Express-MongoDB-ejs

Primary LanguageJavaScript

RESTful-Node

Getting started with Node-Express-MongoDB

clone

git clone https://github.com/VenomVendor/RESTful-Node.git

prerequisites

{}

git clone https://github.com/VenomVendor/RESTful-Node.git
cd RESTful-Node
npm i
gulp

Install dependencies

npm i

Start Mongo Server

mongod

Import MongoDB dump.

cd dump
mongoimport --type csv --headerline weather_data.csv -d weather -c data

Start Server

gulp

Default port

3030

Server URL

http://localhost:3030

APIs

http://localhost:3030/v1/get/weather?limit=0&offset=0&state=Vermont&temperature=lte~39&windSpeed=gt~4.00000&windDir=lt~180&humidity=gte~60

params

param (case-sensitive) Type Default Description
limit integer 100 Max results.
offset integer 0 Skip first {offset} results.
callback string/boolean/integer/json - callback for reference.
id hexa - Hexa-decimal Object(_id) / id
state string - State
airport string - Airport Name
day integer - gt~ / gte~ / lt~ / lte~ ex: gt~4
time integer - gt~ / gte~ / lt~ / lte~ ex: gte~4
temp integer - gt~ / gte~ / lt~ / lte~ ex: lt~4
humid integer - gt~ / gte~ / lt~ / lte~ ex: lte~4
windSpeed integer - gt~ / gte~ / lt~ / lte~ ex: 4
windDir integer - gt~ / gte~ / lt~ / lte~ ex: 4.0
pressureStation integer - gt~ / gte~ / lt~ / lte~ ex: 04
pressureSea integer - gt~ / gte~ / lt~ / lte~ ex: 40

HTML

- http://localhost:3030/v1/(a|b|c|d|RANDOM|*).html

TODO

- Move to ES6.
- Cache DB.

License

Copyright© 2016 VenomVendor <info@VenomVendor.com>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.