diff --git a/src/create.ts b/src/create.ts index dc659ce..98fd91d 100644 --- a/src/create.ts +++ b/src/create.ts @@ -21,8 +21,8 @@ export default class Create { message: `Pick the technology you're using:`, name: 'lang', choices: [ - { name: 'Typescript', value: 'ts' }, - { name: 'Javascript - DEPRECATED', value: 'js' } + { name: 'Typescript', value: 'ts' } + //{ name: 'Javascript - DEPRECATED', value: 'js' } ] }, { diff --git a/src/make-files/express-js/controller.js b/src/make-files/express-js/controller.js deleted file mode 100644 index 798dfa4..0000000 --- a/src/make-files/express-js/controller.js +++ /dev/null @@ -1,8 +0,0 @@ -const root_get = (req, res) => { - res.render('home') - return true -} - -module.exports = { - root_get -} diff --git a/src/make-files/express-js/middleware.js b/src/make-files/express-js/middleware.js deleted file mode 100644 index 154e3b2..0000000 --- a/src/make-files/express-js/middleware.js +++ /dev/null @@ -1,10 +0,0 @@ -const { Router } = require('express') - -const router = Router() - -router.use((req, res, next) => { - console.log('Hi :)') - next() -}) - -module.exports = router diff --git a/src/make-files/express-js/model.js b/src/make-files/express-js/model.js deleted file mode 100644 index 60243a9..0000000 --- a/src/make-files/express-js/model.js +++ /dev/null @@ -1,17 +0,0 @@ -const mongoose = require('mongoose') -const Schema = mongoose.Schema - -const modelSchema = new Schema( - { - title: { - type: String, - required: true - } - }, - { - timestamps: true - } -) - -const ModelName = mongoose.model('ModelName', modelSchema) -module.exports = ModelName diff --git a/src/make-files/express-js/route.js b/src/make-files/express-js/route.js deleted file mode 100644 index 9d0925b..0000000 --- a/src/make-files/express-js/route.js +++ /dev/null @@ -1,8 +0,0 @@ -const { Router } = require('express') -const rootController = require('../controllers/rootController') - -const router = Router() - -router.get('/', rootController.root_get) - -module.exports = router diff --git a/src/make-files/express-js/test.js b/src/make-files/express-js/test.js deleted file mode 100644 index 7949993..0000000 --- a/src/make-files/express-js/test.js +++ /dev/null @@ -1,9 +0,0 @@ -const { getReq, getRes } = require('./modules/reqRes.module.js') -const { root_get } = require('../controllers/rootController.ts') - -test('Home page render test', () => { - const req = getReq() - const res = getRes() - - expect(root_get(req, res)).toBe(true) -}) diff --git a/src/make-files/express-js/view.ejs b/src/make-files/express-js/view.ejs deleted file mode 100644 index faf15cc..0000000 --- a/src/make-files/express-js/view.ejs +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - New Project - - - - - - - - \ No newline at end of file diff --git a/src/skeletons/express-js/.env.example b/src/skeletons/express-js/.env.example deleted file mode 100644 index b1a432b..0000000 --- a/src/skeletons/express-js/.env.example +++ /dev/null @@ -1,2 +0,0 @@ -APP_PORT = 8080 -DB_URI = 'mongodb://username:password@localhost:27017/database?authSource=admin' diff --git a/src/skeletons/express-js/.gitignore b/src/skeletons/express-js/.gitignore deleted file mode 100644 index 66e0c76..0000000 --- a/src/skeletons/express-js/.gitignore +++ /dev/null @@ -1,107 +0,0 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage -*.lcov - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# TypeScript v1 declaration files -typings/ - -# TypeScript cache -*.tsbuildinfo - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Microbundle cache -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env -.env.test - -# parcel-bundler cache (https://parceljs.org/) -.cache - -# Next.js build output -.next - -# Nuxt.js build / generate output -.nuxt -dist - -# Gatsby files -.cache/ -# Comment in the public line in if your project uses Gatsby and *not* Next.js -# https://nextjs.org/blog/next-9-1#public-directory-support -# public - -# vuepress build output -.vuepress/dist - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - -# TernJS port file -.tern-port - -# package lock file -package-lock.json \ No newline at end of file diff --git a/src/skeletons/express-js/README.md b/src/skeletons/express-js/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/src/skeletons/express-js/norkconfig.json b/src/skeletons/express-js/norkconfig.json deleted file mode 100644 index e8fbc3b..0000000 --- a/src/skeletons/express-js/norkconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "lang": "js" -} diff --git a/src/skeletons/express-js/package.json b/src/skeletons/express-js/package.json deleted file mode 100644 index b0f19d4..0000000 --- a/src/skeletons/express-js/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "project-name", - "version": "1.0.0", - "description": "", - "main": "src/app.js", - "scripts": { - "start": "node src/app.js", - "dev": "nodemon src/app.js", - "test": "jest" - }, - "author": "", - "license": "ISC", - "dependencies": { - "cors": "^2.8.5", - "dotenv": "^8.2.0", - "ejs": "^3.1.6", - "express": "^4.17.1", - "mongoose": "^5.12.3", - "morgan": "^1.10.0" - }, - "devDependencies": { - "jest": "^27.0.6" - } -} diff --git a/src/skeletons/express-js/src/app.js b/src/skeletons/express-js/src/app.js deleted file mode 100644 index 985765e..0000000 --- a/src/skeletons/express-js/src/app.js +++ /dev/null @@ -1,41 +0,0 @@ -const express = require('express') -const morgan = require('morgan') -const mongoose = require('mongoose') -const dotenv = require('dotenv').config() -const cors = require('cors') -const path = require('path') - -const routes = require('./routes') -const middlewares = require('./middlewares') - -const port = process.env.APP_PORT || 8080 -const app = express() - -// MongoDB -const dbURI = process.env.DB_URI -mongoose - .connect(dbURI, { useNewUrlParser: true, useUnifiedTopology: true, useCreateIndex: true }) - .then((result) => { - console.log('connected to db') - app.listen(port, () => { - console.log(`server is running on http://localhost:${port}`) - }) - }) - .catch((err) => { - console.log(err) - }) - -// View engine -app.set('view engine', 'ejs') - -// Middlewares -app.use(middlewares) -app.set('views', path.join(__dirname, 'views')) -app.use(express.static(path.join(__dirname, 'public'))) -app.use(cors()) -app.use(morgan('dev')) -app.use(express.urlencoded({ extended: true })) -app.use(express.json()) - -// Routes -app.use(routes) diff --git a/src/skeletons/express-js/src/controllers/rootController.js b/src/skeletons/express-js/src/controllers/rootController.js deleted file mode 100644 index 798dfa4..0000000 --- a/src/skeletons/express-js/src/controllers/rootController.js +++ /dev/null @@ -1,8 +0,0 @@ -const root_get = (req, res) => { - res.render('home') - return true -} - -module.exports = { - root_get -} diff --git a/src/skeletons/express-js/src/middlewares/index.js b/src/skeletons/express-js/src/middlewares/index.js deleted file mode 100644 index ca227fd..0000000 --- a/src/skeletons/express-js/src/middlewares/index.js +++ /dev/null @@ -1,8 +0,0 @@ -const { Router } = require('express') -const sayHiMiddleware = require('./sayHiMiddleware') - -const router = Router() - -router.use(sayHiMiddleware) - -module.exports = router diff --git a/src/skeletons/express-js/src/middlewares/sayHiMiddleware.js b/src/skeletons/express-js/src/middlewares/sayHiMiddleware.js deleted file mode 100644 index 154e3b2..0000000 --- a/src/skeletons/express-js/src/middlewares/sayHiMiddleware.js +++ /dev/null @@ -1,10 +0,0 @@ -const { Router } = require('express') - -const router = Router() - -router.use((req, res, next) => { - console.log('Hi :)') - next() -}) - -module.exports = router diff --git a/src/skeletons/express-js/src/public/expressjs.png b/src/skeletons/express-js/src/public/expressjs.png deleted file mode 100644 index 487c5a8..0000000 Binary files a/src/skeletons/express-js/src/public/expressjs.png and /dev/null differ diff --git a/src/skeletons/express-js/src/public/nodejs_logo.svg b/src/skeletons/express-js/src/public/nodejs_logo.svg deleted file mode 100644 index 41d044a..0000000 --- a/src/skeletons/express-js/src/public/nodejs_logo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/skeletons/express-js/src/routes/index.js b/src/skeletons/express-js/src/routes/index.js deleted file mode 100644 index 27fb8d8..0000000 --- a/src/skeletons/express-js/src/routes/index.js +++ /dev/null @@ -1,13 +0,0 @@ -const { Router } = require('express') -const rootRoutes = require('./rootRoutes') - -const router = Router() - -router.use(rootRoutes) - -// 404 -router.use((req, res) => { - res.status(404).send('E404') -}) - -module.exports = router diff --git a/src/skeletons/express-js/src/routes/rootRoutes.js b/src/skeletons/express-js/src/routes/rootRoutes.js deleted file mode 100644 index 9d0925b..0000000 --- a/src/skeletons/express-js/src/routes/rootRoutes.js +++ /dev/null @@ -1,8 +0,0 @@ -const { Router } = require('express') -const rootController = require('../controllers/rootController') - -const router = Router() - -router.get('/', rootController.root_get) - -module.exports = router diff --git a/src/skeletons/express-js/src/tests/home.test.js b/src/skeletons/express-js/src/tests/home.test.js deleted file mode 100644 index 188e0c3..0000000 --- a/src/skeletons/express-js/src/tests/home.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const { getReq, getRes } = require('./modules/reqRes.module.js') -const { root_get } = require('../controllers/rootController.js') - -test('Home page render test', () => { - const req = getReq() - const res = getRes() - - expect(root_get(req, res)).toBe(true) -}) diff --git a/src/skeletons/express-js/src/tests/modules/reqRes.module.js b/src/skeletons/express-js/src/tests/modules/reqRes.module.js deleted file mode 100644 index 0341a26..0000000 --- a/src/skeletons/express-js/src/tests/modules/reqRes.module.js +++ /dev/null @@ -1,16 +0,0 @@ -module.exports.getReq = () => { - const req = {} - req.body = {} - return req -} - -module.exports.getRes = () => { - const res = {} - res.locals = {} - res.status = () => res - res.json = () => res - res.send = () => res - res.render = () => res - - return res -} diff --git a/src/skeletons/express-js/src/utils/REAME.md b/src/skeletons/express-js/src/utils/REAME.md deleted file mode 100644 index 7e1a454..0000000 --- a/src/skeletons/express-js/src/utils/REAME.md +++ /dev/null @@ -1 +0,0 @@ -# Folder for utils and other config files diff --git a/src/skeletons/express-js/src/views/home.ejs b/src/skeletons/express-js/src/views/home.ejs deleted file mode 100644 index d841985..0000000 --- a/src/skeletons/express-js/src/views/home.ejs +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - New Project - - - - - - -
-
-

Let's make something amazing!

-
- node.js logo - express.js logo -
-
- -
- - \ No newline at end of file