https://github.com/vukanac/api-with-sub-npm-module
https://github.com/vukanac/api-with-sub-npm-module
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/vukanac/api-with-sub-npm-module
- Owner: vukanac
- Created: 2019-02-12T08:21:45.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-02-12T14:28:47.000Z (over 6 years ago)
- Last Synced: 2025-02-10T15:17:45.418Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# API with NPM module (tryout)
The repo contains a sample API server with only one JSON endpoint,
but also contains a sub directory with full NPM module used in
a frentend JS or NodeJS scripts as a client side to get the data
from API server.## API server
This can be any, we use a plain PHP file just to be different lang
than NPM module (JS).## NPM module
A simple client module for accessing API data without worring aboiut
placing HTTP requests, authentication, etc.Writen in sub directory, with JavaScript, it must contain a
`package.json`.This is tryout example how to get an NPM module hosted on GitHub as
a sub directory.npm install --save \
git+https://[email protected]:/.git//As with this demo, with:
npm install --save \
git+https://[email protected]:vukanac/api-with-sub-npm-module.git/npm-number-formatter/we expect to have in client `package.json` a property matched with the
name property from NPM module's package:"dependencies": {
"vukanac_api-with-sub-npm-module_npm-number-formatter":
"git+https://[email protected]:vukanac/api-with-sub-npm-module.git/npm-number-formatter/"
},