Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including ssr with all npm packages installed. Try it out:

var ssr = require("ssr")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

ssr v3.0.0

tudou

Install

$ npm i tudou -g

Usage

  • build
$ ssr build

build 命令将根据 yaml 配置文件中的路由进行打包。支持多路由配置。

  • run server
'use strict'

const path = require('path')

const App = require('faas-runtime')('egg', async (ctx, next) => {
  // add your runtime middware here
  ctx.ssrRender = require('../../index')
  app.use(require('koa-static')(path.join(__dirname, './app/render/dist')))
  await next()
})

const app = new App('./app')

app.listen(3000)
$ open http://localhost:3000/xxx
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free