create-payload-app 0.3.34 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/lib/create-project.js +33 -87
- package/dist/lib/create-project.test.js +37 -52
- package/dist/lib/templates.js +38 -71
- package/dist/lib/write-env-file.js +20 -15
- package/dist/main.js +14 -2
- package/dist/utils/messages.js +2 -1
- package/package.json +1 -1
- package/dist/lib/common-files/Dockerfile.template +0 -26
- package/dist/lib/common-files/README.template.md +0 -19
- package/dist/lib/common-files/docker-compose.template.yml +0 -35
- package/dist/lib/common-files/gitignore.template +0 -166
- package/dist/lib/common-files/nodemon.json +0 -4
- package/dist/lib/common-files/package.template.json +0 -30
- package/dist/lib/common-files/tsconfig.json +0 -34
- package/dist/lib/write-common-files.js +0 -124
- package/dist/templates/blank/src/collections/Examples.ts +0 -17
- package/dist/templates/blank/src/collections/Users.ts +0 -15
- package/dist/templates/blank/src/payload.config.ts +0 -22
- package/dist/templates/blank/src/server.ts +0 -28
- package/dist/templates/blog/src/collections/Categories.ts +0 -20
- package/dist/templates/blog/src/collections/Media.ts +0 -28
- package/dist/templates/blog/src/collections/Posts.ts +0 -62
- package/dist/templates/blog/src/collections/Tags.ts +0 -20
- package/dist/templates/blog/src/collections/Users.ts +0 -18
- package/dist/templates/blog/src/payload.config.ts +0 -21
- package/dist/templates/blog/src/server.ts +0 -28
- package/dist/templates/todo/src/collections/TodoLists.ts +0 -38
- package/dist/templates/todo/src/collections/Users.ts +0 -15
- package/dist/templates/todo/src/payload.config.ts +0 -18
- package/dist/templates/todo/src/server.ts +0 -28
@@ -1,15 +0,0 @@
|
|
1
|
-
import { CollectionConfig } from 'payload/types';
|
2
|
-
|
3
|
-
const Users: CollectionConfig = {
|
4
|
-
slug: 'users',
|
5
|
-
auth: true,
|
6
|
-
admin: {
|
7
|
-
useAsTitle: 'email',
|
8
|
-
},
|
9
|
-
fields: [
|
10
|
-
// Email added by default
|
11
|
-
// Add more fields as needed
|
12
|
-
],
|
13
|
-
};
|
14
|
-
|
15
|
-
export default Users;
|
@@ -1,18 +0,0 @@
|
|
1
|
-
import { buildConfig } from 'payload/config';
|
2
|
-
import path from 'path';
|
3
|
-
import TodoLists from './collections/TodoLists';
|
4
|
-
import Users from './collections/Users';
|
5
|
-
|
6
|
-
export default buildConfig({
|
7
|
-
serverURL: 'http://localhost:3000',
|
8
|
-
admin: {
|
9
|
-
user: Users.slug,
|
10
|
-
},
|
11
|
-
collections: [TodoLists, Users],
|
12
|
-
typescript: {
|
13
|
-
outputFile: path.resolve(__dirname, 'payload-types.ts'),
|
14
|
-
},
|
15
|
-
graphQL: {
|
16
|
-
schemaOutputFile: path.resolve(__dirname, 'generated-schema.graphql'),
|
17
|
-
},
|
18
|
-
})
|
@@ -1,28 +0,0 @@
|
|
1
|
-
import express from 'express';
|
2
|
-
import payload from 'payload';
|
3
|
-
|
4
|
-
require('dotenv').config();
|
5
|
-
const app = express();
|
6
|
-
|
7
|
-
// Redirect root to Admin panel
|
8
|
-
app.get('/', (_, res) => {
|
9
|
-
res.redirect('/admin');
|
10
|
-
});
|
11
|
-
|
12
|
-
const start = async () => {
|
13
|
-
// Initialize Payload
|
14
|
-
await payload.init({
|
15
|
-
secret: process.env.PAYLOAD_SECRET,
|
16
|
-
mongoURL: process.env.MONGODB_URI,
|
17
|
-
express: app,
|
18
|
-
onInit: async () => {
|
19
|
-
payload.logger.info(`Payload Admin URL: ${payload.getAdminURL()}`)
|
20
|
-
},
|
21
|
-
})
|
22
|
-
|
23
|
-
// Add your own express routes here
|
24
|
-
|
25
|
-
app.listen(3000);
|
26
|
-
}
|
27
|
-
|
28
|
-
start();
|