A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.npmjs.com/package/koa-webc below:

koa-webc - npm

import Koa from "koa"
import { KoaWebC } from "koa-webc"

const app = new Koa()
app.use(KoaWebC())

app.use(async ctx => ctx.render("hello-world.webc"))

app.listen(3000)
console.log("http://localhost:3000")
const app = new Koa()
const router = new Router()

router.get("/the-extras", async ctx => {
  // override data options
  await ctx.render("the-extras.webc", {data: {bar: 'baz', xpto: "xpto"}})
})

// middleware registration order is important
app
  .use(KoaWebC({
    bundle: true,
    viewPath: path.join(process.cwd(), "test", "fixtures"),
    data: {
      foo: "foo",
      bar: "bar"
    }
  }))
  .use(router.routes())
  .use(router.allowedMethods())
  .listen(3000)
console.log("http://localhost:3000")

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4