@sizoff/s_game_backend

0.0.0-s0 • Public • Published

Installation

  • Init node project
  • Type this in console
npm i @sizoff/s_game_backend

Info

Creating an app

esm

import SGameBackend from "./sGameBackend/index.mjs";
import path from "path";

let app = new SGameBackend(path.resolve('.'), {
    port: 8080,
    name: "test",
    version: "0.0.0",
    logPath: "./latest.log",
    stopCommand: "stop"
});

app.start(() => {
    app.logger.message(app.routes);
});

cjs

const SGameBackend = require("./sGameBackend/index.mjs");
const path = require("path");

let app = new SGameBackend(path.resolve('.'), {
    port: 8080,
    name: "test",
    version: "0.0.0",
    logPath: "./latest.log",
    stopCommand: "stop"
});

app.start(() => {
    app.logger.message(app.routes);
});

Adding files.json

esm

import SGameBackend from "./sGameBackend/index.mjs";
import {readObject} from "sbackend/files.mjs";
import path from "path";

let app = new SGameBackend(path.resolve('.'), {
    port: 8080,
    name: "test",
    version: "0.0.0",
    logPath: "./latest.log",
    stopCommand: "stop"
});

app.addFilesJson(readObject("./files.json"), p => path.resolve(p));

app.start(() => {
    app.logger.message(app.routes);
});

cjs

const SGameBackend = require("./sGameBackend/index.mjs");
const {readObject} = require("sbackend/files.mjs");
const path = require("path");

let app = new SGameBackend(path.resolve('.'), {
    port: 8080,
    name: "test",
    version: "0.0.0",
    logPath: "./latest.log",
    stopCommand: "stop"
});

app.addFilesJson(readObject("./files.json"), p => path.resolve(p));

app.start(() => {
    app.logger.message(app.routes);
});

Readme

Keywords

none

Package Sidebar

Install

npm i @sizoff/s_game_backend

Weekly Downloads

1

Version

0.0.0-s0

License

ISC

Unpacked Size

9.66 kB

Total Files

5

Last publish

Collaborators

  • sizoff