This file contains hidden or 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
// Requiring modules we are going to use later | |
const inquirer = require("inquirer"); | |
const util = require("util"); | |
const execSync = util.promisify(require("child_process").execSync); | |
// Create the question prompter | |
const prompt = inquirer.createPromptModule(); | |
// Get the build argument that we want to execute after the prompt | |
const finalBuild = process.argv[2]; |
This file contains hidden or 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
{ | |
"name": "testapp", | |
"scripts": { | |
"start": "node start.js 'react-scripts start'", | |
"build": "node start.js 'react-scripts build'", | |
} | |
} |
This file contains hidden or 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
const express = require("express"); | |
const app = express(); | |
const fs = require("fs"); | |
app.get("/", function(req, res) { | |
res.send("Hello World"); | |
}); | |
app.listen(3000); |
This file contains hidden or 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
import { Router } from "express"; | |
export const router: Router = Router(); | |
router.get("/", (req, res) => { | |
res.status(200).send({ | |
message: "v1" | |
}); | |
}); |
This file contains hidden or 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
import { Router } from "express"; | |
var routesVersioning = require("express-routes-versioning")(); | |
export const router: Router = Router(); | |
router.get( | |
"/", | |
routesVersioning({ | |
"1.0.0": (req: any, res: any) => { | |
res.status(200).send({ |
This file contains hidden or 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
#! /usr/bin/env node | |
console.log("Im working"); |
This file contains hidden or 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
#! /usr/bin/env node | |
const fs = require("fs-extra"); | |
const installFolder = process.argv.slice(2)[0]; | |
fs.mkdirSync("./" + installFolder); |
This file contains hidden or 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
{ | |
"name": "sample-name", | |
"version": "1.0.0", | |
"description": "", | |
"main": "app.js", | |
"scripts": { | |
"start": "node app.js", | |
"dev": "nodemon app.js" | |
}, | |
"dependencies": { |
This file contains hidden or 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
const express = require("express"); | |
const app = express(); | |
const port = 3000; | |
app.get("/", (req, res) => { | |
res.send("Hello World!"); | |
}); | |
app.listen(port, () => { | |
console.log(`Example app listening at http://localhost:${port}`); |
This file contains hidden or 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
#! /usr/bin/env node | |
const fs = require("fs-extra"); | |
const installFolder = process.argv.slice(2)[0]; | |
const path = require("path"); | |
try { | |
fs.copySync(path.join(__dirname, "./template"), "./" + installFolder); | |
console.log("Copied base files"); | |
} catch (err) { |
OlderNewer