mirror of
https://github.com/janishutz/libreevent.git
synced 2025-11-25 21:34:24 +00:00
add routes, error & config
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* myevent - routes.js (admin)
|
||||
*
|
||||
* Created by Janis Hutz 03/11/2023, Licensed under the GPL V3 License
|
||||
* https://janishutz.com, development@janishutz.com
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
const path = require( 'path' );
|
||||
|
||||
module.exports = ( app, settings ) => {
|
||||
app.get( '/admin/login', ( request, response ) => {
|
||||
response.sendFile( path.join( __dirname + '/ui/login.html' ) );
|
||||
} );
|
||||
|
||||
|
||||
app.get( '/admin', ( request, response ) => {
|
||||
if ( request.session.loggedIn ) {
|
||||
if ( settings[ 'init' ] ) {
|
||||
response.sendFile( path.join( __dirname + '/ui/panel.html' ) );
|
||||
} else {
|
||||
response.sendFile( path.join( __dirname + '/ui/setup.html' ) );
|
||||
}
|
||||
} else {
|
||||
response.redirect( '/admin/login' );
|
||||
}
|
||||
} );
|
||||
};
|
||||
19
src/server/admin/ui/login.html
Normal file
19
src/server/admin/ui/login.html
Normal file
@@ -0,0 +1,19 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>login :: myevent - admin panel</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="content">
|
||||
<img src="/assets/logo.png" alt="myevent-logo" class="logo">
|
||||
<div class="lang" id="en">
|
||||
<h1>Welcome to myevent!</h1>
|
||||
<p>Thank you for installing and using myevent! Let's get started by setting it up! First plan of action is to log in to the admin panel where you can replace this page here with your own landing page!</p>
|
||||
<a href="/admin/login" class="button">To the admin panel</a>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user