You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
797 B

3 years ago
import token from '@fastify/csrf'
/**
* index
*
* - home view
* - logout user
*
*
3 years ago
* @author Björn Hase, me@herr-hase.wtf
3 years ago
* @license http://opensource.org/licenses/MIT The MIT License
3 years ago
* @link https://gitea.node001.net/HerrHase/super-hog
3 years ago
*
*/
export default async function(fastify, opts)
{
/**
* home
*
* @param {object} request
* @param {object} response
*
*/
3 years ago
fastify.get('/', (request, response) =>
3 years ago
{
3 years ago
response.view('../frontend/views/index')
3 years ago
})
/**
3 years ago
* logout
3 years ago
*
* @param {object} request
* @param {object} response
*
*/
fastify.get('/logout', async function(request, response)
{
request.destroySession(() => {
response.redirect('/')
})
})
}