@boutdecode/yion
v1.2.3
Published
Yion bundle by boutdecode
Downloads
21
Readme
Yion bundle by Bout de code
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,
assets
} = 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.use(assets())
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)
OR you can bootstrap application in one line
const { bootstrap } = require('@boutdecode/yion')
bootstrap({
api: true,
view: 'jsx',
store: true,
config: {
application: {
port: 8080
}
}
})
Tests
$ npm run test