* feat: update templates to 2.0 and support create-payload-app * chore: rich text updates * chore(templates): remove mongoURL * chore: migrates rich text fields in website * chore: manually aliases dotenv in templates * chore: installs new beta in website template * chore: type issues * chore (template): add alias for fs to website template * chore: more template updates --------- Co-authored-by: James <james@trbl.design> Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
28 lines
513 B
TypeScript
28 lines
513 B
TypeScript
import express from 'express'
|
|
import payload from 'payload'
|
|
|
|
require('dotenv').config()
|
|
const app = express()
|
|
|
|
// Redirect root to Admin panel
|
|
app.get('/', (_, res) => {
|
|
res.redirect('/admin')
|
|
})
|
|
|
|
const start = async () => {
|
|
// Initialize Payload
|
|
await payload.init({
|
|
secret: process.env.PAYLOAD_SECRET,
|
|
express: app,
|
|
onInit: async () => {
|
|
payload.logger.info(`Payload Admin URL: ${payload.getAdminURL()}`)
|
|
},
|
|
})
|
|
|
|
// Add your own express routes here
|
|
|
|
app.listen(3000)
|
|
}
|
|
|
|
start()
|