1.15.0 • Published 5 months ago

@modular-rest/server v1.15.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

@modular-rest/server-ts

TypeScript version of a Node.js module based on Koa.js for developing REST APIs in a modular solution.

Version 1.12 Breaking Changes

The 1.12 release includes several breaking changes:

  • Complete rewrite in TypeScript with full type safety and improved IDE support
  • Auto-generated API documentation using TypeDoc
  • Changed configuration structure for better TypeScript support

Migration Status

This is a TypeScript migration of the original @modular-rest/server package. While maintaining compatibility with the JavaScript version, it adds type safety and better developer experience.

Installation

npm install @modular-rest/server-ts
# or
yarn add @modular-rest/server-ts

Usage

import { createRest } from '@modular-rest/server-ts';

// Create a Koa application with modular-rest
createRest({
  port: 3000,
  modulesPath: __dirname + '/modules',
  uploadDirectory: __dirname + '/uploads',
  staticPath: {
    rootDir: __dirname + '/assets',
    rootPath: '/assets'
  },
  mongo: {
    mongoBaseAddress: 'mongodb://localhost:27017',
    dbPrefix: 'myapp_'
  },
  adminUser: {
    email: 'admin@example.com',
    password: 'securePassword'
  }
}).then(({ app, server }) => {
  console.log('Server started successfully');
});

Key Features

  • Modular REST API development with Koa.js
  • Built-in MongoDB integration
  • User authentication and authorization
  • File upload and management
  • Event system
  • Extensible architecture

TypeScript Support

This package includes full TypeScript type definitions for all API components. The entire codebase is written in TypeScript, providing:

  • IntelliSense and autocompletion in modern IDEs
  • Type safety for all API operations
  • Better compile-time error detection
  • Improved developer experience

Documentation

The API documentation is automatically generated using TypeDoc. You can access the latest documentation:

Development

To build the package:

yarn build

To run the development build with watch mode:

yarn dev

To generate documentation:

yarn docs

License

MIT

1.14.1

5 months ago

1.14.0

6 months ago

1.12.2

7 months ago

1.12.1

7 months ago

1.12.0

7 months ago

1.11.14

7 months ago

1.11.12

7 months ago

1.11.13

7 months ago

1.15.0

5 months ago

1.13.2

7 months ago

1.13.1

7 months ago

1.13.0

7 months ago

1.13.4

6 months ago

1.13.3

6 months ago

1.11.8

1 year ago

1.11.7

1 year ago

1.11.9

1 year ago

1.11.11

1 year ago

1.11.6

1 year ago

1.11.4

1 year ago

1.11.3

1 year ago

1.11.2

1 year ago

1.11.5

1 year ago

1.11.1

1 year ago

1.11.0

1 year ago

1.10.4

2 years ago

1.10.3

2 years ago

1.10.2

2 years ago

1.10.1

2 years ago

1.10.0

2 years ago

1.8.0

2 years ago

1.7.0

2 years ago

1.6.6

2 years ago

1.6.4

2 years ago

1.6.3

2 years ago

1.6.2

2 years ago

1.6.1

2 years ago

1.5.2

2 years ago

1.4.3

2 years ago

1.6.0

2 years ago

1.5.1

2 years ago

1.4.2

2 years ago

1.3.3

2 years ago

1.5.0

2 years ago

1.4.1

2 years ago

1.3.2

2 years ago

1.4.0

2 years ago

1.6.5

2 years ago

1.2.4

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.3

5 years ago

1.2.1

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago