New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

simple-boot-http-ssr

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-boot-http-ssr

back end http server frameworks

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-87.5%
Maintainers
1
Weekly downloads
 
Created
Source

SIMPLE-BOOT-HTTP-SERVER

package.json

{
  "scripts": {
    "watch": "nodemon -e ts -w ./src -w ../../src --exec 'ts-node --project tsconfig-ssr.json -r tsconfig-paths/register src/server.ts'",
    "watch:test": "nodemon --watch 'src/*.ts' --ignore 'src/**/*.spec.ts' --exec 'echo 11'",
    "start": "ts-node --project tsconfig-ssr.json -r tsconfig-paths/register src/server.ts",
    "build": "tsc src/server.ts",
    "build:server": "parcel build src/server.ts --target node",
    "build:tt": "rm -rf build && parcel build src/index.ts --out-dir build --no-source-maps",
    "build:parcel": "rm -rf ./public && parcel build src/index.html --out-dir ./public",
    "watch:parcel": "rm -rf ./public && parcel watch src/index.html --out-dir ./public",
    "start:parcel": "rm -rf ./public && parcel --port 3000 src/index.html ./public",
    "dev": "ts-node-dev --respawn  --project tsconfig-ssr.json -r tsconfig-paths/register src/index.ts",
    "build:prod": "cross-env NODE_ENV=production parcel build src/index.html --public-url .",
    "test": "jest --detectOpenHandles --forceExit"
  }
}

server

server.ts

import {SimpleBootHttpSsr} from 'simple-boot-http-ssr/SimpleBootHttpSsr';
import {HttpServerOption} from 'simple-boot-http-ssr/option/HttpServerOption';
import path from 'path';
import {frontConfig} from './frontConfig';
import {ServerRouter} from './app-server/ServerRouter';
const httpServerOption = new HttpServerOption();
httpServerOption.publicPath = path.join(__dirname, '..', 'public');
new SimpleBootHttpSsr(ServerRouter, frontConfig, httpServerOption).run();

tsconfig-ssr.json

{
  "extends": "./tsconfig.json",
  "compilerOptions": {
    "paths": {
      "@fetch": ["../../src/fetch/server"]
    }
  }
}

front

index.ts (front)

import {SimpleBootFront} from 'simple-boot-front/SimpleBootFront';
import {AppRouter} from './app/AppRouter';
import {frontConfig} from './frontConfig';
const simpleApplication = new SimpleBootFront(AppRouter, frontConfig);
simpleApplication.run();

tsconfig.json

{
  "paths": {
    "@fetch": ["../../src/fetch/front"]
  }
}

one source (server, front)

@Sim()
export class Index extends FrontModule {
    constructor() {
        super({name: __dirname, template: 'fetch://./index.html', styleImports: ['h1{color:red}'], fetcher: ssrFetch});
    }

    public goServer() {
        console.log('goServer')
        ssrFetch.json('/server', {name: 'visualkhh 빵꾸똥꾸'})
    }
}

Keywords

FAQs

Package last updated on 17 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc