@node-ts-autumn/server
under construction
Last updated 3 years ago by mafh .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @node-ts-autumn/server 
SYNC missed versions from official npm registry.

@node-ts-autumn/server


server-module

server module for @node-ts-autumn/core

server-module

...for typescript node mvc framework @node-ts-autumn/core

development state

alpha version

Features

  • link more than one @node-ts-autumn/core application to one server with different contexts

Install

npm

`npm install @node-ts-autumn/server

tsconfig

    {
        "compilerOptions": {
            "typeRoots": ["node_modules/@types", "node_modules/@node-ts-autumn"],
            "types": ["node","server"],
        },
    }

Example Server

Server

Configure the main server by setting up an Server class that extends the AbstractServer class from @node-ts-autumn/server.

This is an example Server class for the server.

global['basepath'] = __dirname;
import { AbstractServer, ServerConfig  } from '@node-ts-autumn/server';
import { Application } from '@node-ts-autumn/server';

import { MyServerConfig } from './lib/config/server/server_config';
import { MyApplication } from './lib/application';
import { FileApplication } from './lib/file_application';

export class MyServer extends AbstractServer {

    constructor () {
        super();
    }

    public getServerConfig (): ServerConfig {
        let serverConfig: ServerConfig = new MyServerConfig();
        return serverConfig;
    }

    public getApplications (): Array<Application> {
        let applications: Array<Application> = new Array<Application>();
        applications.push(new FileApplication());
        applications.push(new MyApplication());
        return applications;
    }
}

!new MyServer();

ServerConfig

import { AbstractServerConfig, ServerConfig } from '@node-ts-autumn/server';


export class MyServerConfig extends AbstractServerConfig implements ServerConfig {

    constructor () {
        super();
        this.setPort(3000);
        this.setStartUpMessage('MyServer');
    }
}

Current Tags

  • 0.3.4                                ...           latest (3 years ago)

3 Versions

  • 0.3.4                                ...           3 years ago
  • 0.3.3                                ...           3 years ago
  • 0.3.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 2
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |