https://github.com/clarketm/blog-api-node
Blog API - Node
https://github.com/clarketm/blog-api-node
api blog blogger loopback microservice node nodejs
Last synced: about 2 months ago
JSON representation
Blog API - Node
- Host: GitHub
- URL: https://github.com/clarketm/blog-api-node
- Owner: clarketm
- Created: 2017-04-26T02:03:31.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-06-09T01:26:38.000Z (almost 8 years ago)
- Last Synced: 2025-01-16T17:01:01.528Z (3 months ago)
- Topics: api, blog, blogger, loopback, microservice, node, nodejs
- Language: JavaScript
- Homepage:
- Size: 9.77 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Blog API - Node
**Live Demo** coming soon!## Installation
```bash
$ npm install
```## Configuration
```js
/* config.json */
{
"restApiRoot": "/v1", // api root
"host": "0.0.0.0", // host
"port": 3000, // port
...
}
```
```js
/* datasources.json */
{
///////////////////////////////////////
// in-memory database (testing ONLY) //
///////////////////////////////////////
"db": {
"name": "db",
"connector": "memory"
},
/////////////////////////////////////////
// transient database (embeded models) //
/////////////////////////////////////////
"transient": {
"name": "transient",
"connector": "transient"
},
////////////////////////////////////
// MongoDB database ////////////////
////////////////////////////////////
// [1] install and run mongodb /////
////////////////////////////////////
"mongodb": {
"host": "127.0.0.1",
"port": 27017,
"database": "blog",
"name": "mongodb",
"connector": "mongodb"
},
/////////////////////////////////////////
// Redis KV database (analytics cache) //
/////////////////////////////////////////
// [1] install and run redis ////////////
/////////////////////////////////////////
"redis": {
"host": "127.0.0.1",
"port": 6379,
"name": "redis",
"db": 0,
"connector": "kv-redis"
}
}
```## Running
```bash
$ npm startWeb server listening at: http://0.0.0.0:3000
Browse your REST API at http://0.0.0.0:3000/explorer
```## Persisted Models
### Blog
| Property | Type | Required | Default |
|-------------|--------|----------|---------|
| kind | string | false |blog#blog|
| name | string | false | |
| description| string | false | |
| published | date | false | |
| updated | date | false | |
| url | string | false | |##### Embeded Transient Models
* **Locale**| Property | Type | Required | Default |
|-------------|--------|----------|---------|
| language | string | false | |
| country | string | false | |### Post
| Property | Type | Required | Default |
|-------------|--------|----------|---------|
| kind | string | false |blog#post|
| title | string | false | |
| content | object | false | |
| published | date | false | |
| updated | date | false | |
| url | string | false | |### Comment
| Property | Type | Required | Default |
|-------------|--------|----------|---------|
| kind | string | false |blog#comment|
| content | object | false | |
| published | date | false | |
| updated | date | false | |### Author
| Property | Type | Required | Default |
|-------------|--------|----------|---------|
| displayName | string | false | |
| url | string | false | |##### Embeded Models
* **Image** as profileImage| Property | Type | Required | Default |
|-------------|--------|----------|---------|
| url | string | false | |### Reader
| Property | Type | Required | Default |
|-------------|--------|----------|---------|
| displayName | string | false | |
| url | string | false | |##### Embeded Transient Models
* **Image** as profileImage| Property | Type | Required | Default |
|-------------|--------|----------|---------|
| url | string | false | |## KeyValue Models
* Analytics## Operations
WIP## Usage
WIP## :star: Credits
Special thanks the the following:
* [Loopback](https://loopback.io/) - StrongLoop