-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: start api will start server
- Loading branch information
phshy0607
committed
Mar 31, 2022
1 parent
2f80e1e
commit 0565979
Showing
3 changed files
with
19 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
import { createServer as createViteServer } from 'vite'; | ||
import { resolveConfig } from './config.js'; | ||
import { UserConfig } from './types.js'; | ||
import { docit } from './plugins/index.js'; | ||
import { createServer as createViteServer } from "vite"; | ||
import { resolveConfig } from "./config.js"; | ||
import { UserConfig } from "./types.js"; | ||
import { docit } from "./plugins/index.js"; | ||
|
||
export const start = async (userConfig: UserConfig) => { | ||
const config = await resolveConfig(userConfig, 'start'); | ||
const config = await resolveConfig(userConfig, "start"); | ||
return createViteServer({ | ||
base: '/', | ||
base: "/", | ||
plugins: [await docit(config)], | ||
}); | ||
}) | ||
.then((s) => s.listen()) | ||
.then((s) => { | ||
s.printUrls(); | ||
return s; | ||
}); | ||
}; |