mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-01 19:27:48 +02:00
Allow server port to be chosen and update example
This commit is contained in:
parent
6fbde4eead
commit
0f6800df10
3 changed files with 8 additions and 5 deletions
|
@ -52,7 +52,7 @@ class Help extends React.Component {
|
||||||
</h2>
|
</h2>
|
||||||
</header>
|
</header>
|
||||||
<p>
|
<p>
|
||||||
<translate>
|
<translate desc="statement made to reader">
|
||||||
This project is maintained by a dedicated group of people.
|
This project is maintained by a dedicated group of people.
|
||||||
</translate>
|
</translate>
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
* of patent rights can be found in the PATENTS file in the same directory.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function execute() {
|
function execute(port) {
|
||||||
const translation = require("./translation.js");
|
const translation = require("./translation.js");
|
||||||
translation();
|
translation();
|
||||||
const CWD = process.cwd();
|
const CWD = process.cwd();
|
||||||
|
@ -113,8 +113,6 @@ function execute() {
|
||||||
|
|
||||||
console.log("server.js triggered...");
|
console.log("server.js triggered...");
|
||||||
|
|
||||||
const port = 3000;
|
|
||||||
|
|
||||||
reloadMetadataCategories();
|
reloadMetadataCategories();
|
||||||
|
|
||||||
/* handle all requests for document pages */
|
/* handle all requests for document pages */
|
||||||
|
|
|
@ -14,5 +14,10 @@ require("babel-register")({
|
||||||
presets: ["react"]
|
presets: ["react"]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let port = 3000;
|
||||||
|
if (process.argv.length > 2) {
|
||||||
|
port = process.argv[2];
|
||||||
|
}
|
||||||
|
|
||||||
const server = require("./server/server.js");
|
const server = require("./server/server.js");
|
||||||
server();
|
server(port);
|
||||||
|
|
Loading…
Add table
Reference in a new issue