1.1.1 • Published 2 months ago

@boutdecode/yion v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

Yion bundle by Bout de code

https://boutdecode.fr

Bout de code - Développement de site internet et blog avec de vrais morceaux de codes, simples, élégants, utiles (parfois) et surtout sans fioriture.

Installation

$ npm install @boutdecode/yion

Yion plugin

For yion :

const { 
  createApp,
  createServer,
  bodyParser,
  logger,
  session,
  encoding,
  i18n
} = require('@boutdecode/yion')

const app = createApp()
const server = createServer(app)

app.use(logger())
app.use(bodyParser())
app.use(session())
app.use(encoding())
app.use(i18n())

app.get('/', ({ res }) => {
  res
    .set('Content-Type', 'text/html; charset=utf-8')
    .set('Content-Encoding', 'gzip')
    .send(`
      <!DOCTYPE html>
      <html>
        <head>
          <title>Yion</title>
          <meta charset="utf-8">
        </head>
        <body>
          <h1>Hello world</h1>
        </body>
      </html>
    `)
})

server.listen(8080)

Tests

$ npm run test