Skip to content

Commit 76f2899

Browse files
committed
Version 1.2.2.
1 parent 7baf0ee commit 76f2899

2 files changed

Lines changed: 26 additions & 28 deletions

File tree

README.md

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Evolutility-Server-Node · [![GitHub license](https://img.shields.io/github/license/evoluteur/evolutility-server-node)](https://github.com/evoluteur/evolutility-server-node/blob/master/LICENSE.md) [![npm version](https://img.shields.io/npm/v/evolutility-server-node)](https://www.npmjs.com/package/evolutility-server-node)
22

3-
43
Model-driven REST API for CRUD and more, using Node.js, Express, and PostgreSQL.
54

65
Evolutility-Server-Node provides a set of generic [REST APIs](#API) for CRUD (Create, Read, Update, Delete) and simple charts. on objects of different structures.
@@ -9,8 +8,8 @@ Evolutility-Server-Node provides a set of generic [REST APIs](#API) for CRUD (Cr
98

109
For a matching model-driven Web UI, use [Evolutility-UI-React](http://github.com/evoluteur/evolutility-ui-react) or [Evolutility-UI-jQuery](http://evoluteur.github.io/evolutility-ui-jquery/).
1110

11+
## Table of Contents
1212

13-
### Table of Contents
1413
1. [Installation](#Installation)
1514
2. [Setup](#Setup)
1615
3. [Configuration](#Configuration)
@@ -27,6 +26,7 @@ For a matching model-driven Web UI, use [Evolutility-UI-React](http://github.com
2726
# To get the latest stable version, use git from the command line.
2827
git clone https://github.com/evoluteur/evolutility-server-node
2928
```
29+
3030
or use the [npm package](https://www.npmjs.com/package/evolutility-server-node):
3131

3232
```bash
@@ -82,31 +82,30 @@ URLs on localhost:
8282

8383
- REST: [http://localhost:2000/api/v1/](http://localhost:2000/api/v1/)
8484

85-
8685
<a name="Configuration"></a>
8786
## Configuration
8887

8988
Configuration options are set in the file [config.js](https://github.com/evoluteur/evolutility-server-node/blob/master/config.js).
9089

91-
92-
| Option | Description |
93-
|---------------|-----------------------------------------|
94-
| apiPath | Path for REST API (i.e.: "/api/v1/"). |
95-
| apiPort | Port for REST API (i.e.: 2000). |
96-
| connectionString | DB connection string (i.e.: "postgres://evol:love@localhost:5432/evol"). |
97-
| schema | DB schema name (i.e.: "evolutility").|
98-
| pageSize | Number of rows per page in pagination (default = 50).|
99-
| lovSize | Maximum number of values allowed for form dropdowns (default = 100). |
100-
| csvSize | Maximum number of rows in CSV export (default = 1000).|
101-
| csvHeader | CSV list of labels for CSV export| | uploadPath | path for pictures and documents uploads (i.e.: "../evolutility-ui-react/public/pix/").|
102-
| logToConsole | Log SQL and errors to console.|
103-
| logToFile | Log SQL and errors to a file. Log files are named like "evol-2019-09-15.log". |
104-
| wComments | Allow for user comments (not implemented yet). |
105-
| wRating | Allow for user ratings (not implemented yet). |
106-
| wTimestamp | Timestamp columns w/ date of record creation and last update. |
90+
| Option | Description |
91+
|-------------------|-----------------------------------------|
92+
| apiPath | Path for REST API (i.e.: "/api/v1/"). |
93+
| apiPort | Port for REST API (i.e.: 2000). |
94+
| connectionString | DB connection string (i.e.: "postgres://evol:love@localhost:5432/evol"). |
95+
| schema | DB schema name (i.e.: "evolutility").|
96+
| pageSize | Number of rows per page in pagination (default = 50).|
97+
| lovSize | Maximum number of values allowed for form dropdowns (default = 100). |
98+
| csvSize | Maximum number of rows in CSV export (default = 1000).|
99+
| csvHeader | CSV list of labels for CSV export|
100+
| uploadPath | path for pictures and documents uploads (i.e.: "../evolutility-ui-react/public/pix/").|
101+
| logToConsole | Log SQL and errors to console.|
102+
| logToFile | Log SQL and errors to a file. Log files are named like "evol-2019-09-15.log". |
103+
| wComments | Allow for user comments (not implemented yet). |
104+
| wRating | Allow for user ratings (not implemented yet). |
105+
| wTimestamp | Timestamp columns w/ date of record creation and last update. |
107106
| createdDateColumn | Column containing created date (default "created_at"). |
108107
| updatedDateColumn | Column containing last update date (default "updated_at"). |
109-
| schemaQueries | Enables endpoints to query for lists of tables and columns in the database schema. |
108+
| schemaQueries | Enables endpoints to query for lists of tables and columns in the database schema. |
110109

111110
<a name="Models"></a>
112111
## Models
@@ -119,7 +118,6 @@ Models contain the name of the driving table and the list of fields/columns pres
119118
- [Collection](#Collection)
120119
- [Sample model](#SampleModel)
121120

122-
123121
<a name="Object"></a>
124122
### Object
125123

@@ -156,7 +154,6 @@ Models contain the name of the driving table and the list of fields/columns pres
156154
| noStats | Exclude field from Stats. |
157155
| deleteTrigger | Deleting records in the lovTable will trigger a cascade delete (this property is only used while creating the database). |
158156

159-
160157
<a name="Collection"></a>
161158
### Collection
162159

@@ -173,7 +170,6 @@ Multiple Master-Details can be specified with collections.
173170

174171
Example of collection in [Wine cellar](https://github.com/evoluteur/evolutility-server-node/blob/master/models/organizer/winecellar.js).
175172

176-
177173
<a name="SampleModel"></a>
178174
### Sample model
179175

@@ -240,6 +236,7 @@ More information about Evolutility models and some useful scripts are available
240236

241237
<a name="API"></a>
242238
## REST API
239+
243240
Evolutility-Server-Node provides a generic RESTful API for CRUD (Create, Read, Update, Delete) and more. It is inspired from [PostgREST](http://postgrest.com).
244241

245242
- [Get](#API_Get)
@@ -254,6 +251,7 @@ When running Evolutility-Server-Node locally, the base url is
254251
### Requesting Information
255252

256253
#### Get One
254+
257255
Gets a specific record by ID.
258256

259257
```
@@ -271,6 +269,7 @@ GET /todo/12?shallow=1
271269
```
272270

273271
#### Get Many
272+
274273
Gets a list of records.
275274

276275
```
@@ -279,9 +278,9 @@ GET /{model.id}
279278
GET /todo
280279
```
281280

282-
283281
<a name="Filtering"></a>
284282
#### Filtering
283+
285284
You can filter result rows by adding conditions on fields, each condition is a query string parameter.
286285

287286
```
@@ -314,7 +313,6 @@ For each field a sub-set of the operators below will be supported by the API (de
314313
| null | is null | /todo?category=null |
315314
| nn | is not null | /todo?category==nn |
316315

317-
318316
#### Searching
319317

320318
You can search for a specific string across multiple fields at once with the "search" parameter. The list of fields to be searched is specified with "searchFields" in the model (if unspecified, text fields flagged with "inMany" for list view will be used).
@@ -359,6 +357,7 @@ GET /{model.id}?format=csv
359357
360358
GET /todo?format=csv
361359
```
360+
362361
Notes: In the returned data every object has an extra property "\_full_count" which indicate the total number of records in the query (before limit).
363362

364363
<a name="API_Update"></a>
@@ -397,8 +396,8 @@ PUT /todo/5
397396

398397
Notes: The request returns the updated record. It is not standard but it saves the UI a subsequent call.
399398

400-
401399
#### Deletion
400+
402401
Simply use the DELETE verb with the id of the record to remove.
403402

404403
```
@@ -484,7 +483,6 @@ POST /comics/upload/5
484483

485484
With query parameters: file and "field.id".
486485

487-
488486
#### Nested collections
489487

490488
If the model has collections defined, they can be queried with this end-point.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "evolutility-server-node",
3-
"version": "1.2.1",
3+
"version": "1.2.2",
44
"description": "Build CRUD API endpoints with models rather than code.",
55
"license": "AGPL-3.0",
66
"homepage": "https://github.com/evoluteur/evolutility-server-node",

0 commit comments

Comments
 (0)