GithubHelp home page GithubHelp logo

fulton-topdog's Introduction

How to setup a new project using fulton-server

npm init
npm install fulton-server --save-dev

npm install typescript -g
tsc --init

Edit tsconfig.json:

{
    "compilerOptions": {
        /* Basic Options */
        "target": "es6",                          /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */
        "module": "commonjs",                     /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
        "sourceMap": true,                     /* Generates corresponding '.map' file. */
        "outDir": "./build",                        /* Redirect output structure to the directory. */

        /* Strict Type-Checking Options */
        "strict": true,                            /* Enable all strict type-checking options. */
        "strictNullChecks": false,              /* Disable strict null checks. */
        "skipLibCheck": true,

        /* Source Map Options */
        "sourceRoot": "./src",                    /* Specify the location where debugger should locate TypeScript files instead of source locations. */

        /* Experimental Options */
        "experimentalDecorators": true,        /* Enables experimental support for ES7 decorators. */
        "emitDecoratorMetadata": true         /* Enables experimental support for emitting type metadata for decorators. */
    }
}

Edit package.json:

    ...
    "main": "./build/app.js",
    "scripts": {
        "build": "tsc -p ./",
        "start": "ts-node ./src/app.ts",
    }
    ...

Create a file ./src/app.ts:

import { FultonApp, FultonAppOptions } from "fulton-server"

export class TopDogApp extends FultonApp {
    protected onInit(options: FultonAppOptions): void | Promise<void> {
        options.index.message = "Hello World!\n"
    }
}

let app = new TopDogApp();

app.start();

Start a HelloWorld:

npm start &
curl http://localhost:3000

fulton-topdog's People

Contributors

touren avatar

Watchers

Cap'n Coconut avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.