Skip to content

Commit

Permalink
chore: Various updates
Browse files Browse the repository at this point in the history
Added build status and coverage badges
Fixed server definitions export
  • Loading branch information
Filippo Conti committed Oct 25, 2019
1 parent 9bdb8a6 commit 0a3dd20
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

A customizable fully working express REST JSON server.

[![Build Status](https://travis-ci.org/b4dnewz/json-server.svg?branch=master)](https://travis-ci.org/b4dnewz/json-server) [![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org/) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/b4dnewz/json-server/blob/master/LICENSE)
[![Build Status](https://travis-ci.org/b4dnewz/json-server.svg?branch=master)](https://travis-ci.org/b4dnewz/json-server) [![Coverage Status](https://coveralls.io/repos/github/b4dnewz/json-server/badge.svg?branch=master)](https://coveralls.io/github/b4dnewz/json-server?branch=master)

[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org/) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/b4dnewz/json-server/blob/master/LICENSE)

## Features

Expand Down
6 changes: 3 additions & 3 deletions packages/core/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@
"public"
],
"scripts": {
"postinstall": "npm run build:front",
"prepublishOnly": "npm run build",
"postinstall": "npm run build:front",
"test": "jest",
"lint": "tslint -p . --fix",
"serve": "vue-cli-service serve",
"build": "tsc && npm run front:build",
"build:front": "vue-cli-service build --no-clean"
"build": "tsc && npm run build:front",
"build:front": "vue-cli-service build --no-clean"
},
"dependencies": {
"compression": "^1.7.4",
Expand Down
9 changes: 5 additions & 4 deletions packages/core/src/server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { CompressionOptions } from "compression";
import { CorsOptions } from "cors";
import * as express from "express";
import { Application, RequestHandler, Router } from "express";
import express = require("express");
import { LowdbSync } from "lowdb";

import createMiddlewares from "./defaults";
Expand All @@ -15,7 +16,7 @@ const defaultOptions: ServerOptions = {
gzip: true,
};

export interface JsonServer extends express.Application {
export interface JsonServer extends Application {
config: ServerOptions;
db: LowdbSync<any>;
}
Expand All @@ -28,8 +29,8 @@ export interface ServerOptions extends RouterOptions {
readOnly?: boolean;
static?: string;
bodyParser?: boolean;
rewriter?: express.Router;
middlewares?: express.RequestHandler[];
rewriter?: Router;
middlewares?: RequestHandler[];
}

/**
Expand Down

0 comments on commit 0a3dd20

Please sign in to comment.