-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
39 lines (33 loc) · 1.04 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import 'dotenv/config.js'
import { Indiekit } from '@indiekit/indiekit'
import { EleventyPreset } from './11ty.js'
import { GithubStore } from '@indiekit/store-github'
if (!process.env.TOKEN) {
console.log('missing TOKEN .env key')
process.exit(1)
}
if (!process.env.USERNAME) {
console.log('missing USERNAME .env key')
process.exit(1)
}
if (!process.env.REPO) {
console.log('missing REPO .env key')
process.exit(1)
}
const github = new GithubStore({
user: process.env.USERNAME, // Your username on GitHub
repo: process.env.REPO, // Repository files will be saved to
branch: 'master', // Branch to publish to
token: process.env.TOKEN, // GitHub personal access token
})
const eleventy = new EleventyPreset()
// Create a new indiekit instance
const indiekit = new Indiekit()
indiekit.set('publication.me', 'https://rafaj.dev')
indiekit.set('publication.preset', eleventy)
indiekit.set('publication.store', github)
// Create a server
export function run() {
return indiekit.server({ port: process.env.NODE_PORT || 4000 })
}
// Export server