@alchemycodelab/create-app
Advanced tools
Comparing version 6.2.6 to 7.0.0
@@ -6,5 +6,5 @@ { | ||
"main": "index.js", | ||
"type": "module", | ||
"type": "commonjs", | ||
"scripts": { | ||
"test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest --verbose --runInBand --testLocationInResults", | ||
"test": "jest --verbose --runInBand --testLocationInResults", | ||
"test:watch": "npm run test -- --watch", | ||
@@ -11,0 +11,0 @@ "start": "node index.js", |
@@ -1,7 +0,7 @@ | ||
import pool from '../lib/utils/pool.js'; | ||
import setup from '../data/setup.js'; | ||
import request from 'supertest'; | ||
import app from '../lib/app.js'; | ||
const pool = require('../lib/utils/pool.js'); | ||
const setup = require('../data/setup.js'); | ||
const request = require('supertest'); | ||
const app = require('../lib/app.js'); | ||
describe('demo routes', () => { | ||
describe('{{appName}} routes', () => { | ||
beforeEach(() => { | ||
@@ -8,0 +8,0 @@ return setup(pool); |
@@ -1,6 +0,7 @@ | ||
import { promises as fs } from 'fs'; | ||
const fs = require('fs').promises; | ||
export default (pool) => { | ||
return fs.readFile('./sql/setup.sql', { encoding: 'utf-8' }) | ||
.then(sql => pool.query(sql)); | ||
module.exports = (pool) => { | ||
return fs | ||
.readFile(`${__dirname}/../sql/setup.sql`, { encoding: 'utf-8' }) | ||
.then((sql) => pool.query(sql)); | ||
}; |
@@ -1,4 +0,2 @@ | ||
import express from 'express'; | ||
import notFoundMiddleware from './middleware/not-found.js'; | ||
import errorMiddleware from './middleware/error.js'; | ||
const express = require('express'); | ||
@@ -9,5 +7,5 @@ const app = express(); | ||
app.use(notFoundMiddleware); | ||
app.use(errorMiddleware); | ||
app.use(require('./middleware/not-found.js')); | ||
app.use(require('./middleware/error.js')); | ||
export default app; | ||
module.exports = app; |
// eslint-disable-next-line no-unused-vars | ||
export default (err, req, res, next) => { | ||
let status = err.status || 500; | ||
module.exports = (err, req, res, next) => { | ||
const status = err.status || 500; | ||
@@ -11,4 +11,4 @@ res.status(status); | ||
status, | ||
message: err.message | ||
message: err.message, | ||
}); | ||
}; |
@@ -1,2 +0,2 @@ | ||
export default (req, res, next) => { | ||
module.exports = (req, res, next) => { | ||
const err = new Error('Not Found'); | ||
@@ -3,0 +3,0 @@ err.status = 404; |
@@ -1,4 +0,4 @@ | ||
import pg from 'pg'; | ||
const { Pool } = require('pg'); | ||
const pool = new pg.Pool({ | ||
const pool = new Pool({ | ||
connectionString: process.env.DATABASE_URL, | ||
@@ -8,4 +8,5 @@ ssl: process.env.PGSSLMODE && { rejectUnauthorized: false }, | ||
// eslint-disable-next-line no-console | ||
pool.on('connect', () => console.log('Postgres connected')); | ||
export default pool; | ||
module.exports = pool; |
@@ -6,5 +6,5 @@ { | ||
"main": "server.js", | ||
"type": "module", | ||
"type": "commonjs", | ||
"scripts": { | ||
"test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest --verbose --runInBand --testLocationInResults --setupFiles dotenv/config", | ||
"test": "jest --verbose --runInBand --testLocationInResults --setupFiles dotenv/config", | ||
"test:watch": "npm run test -- --watch", | ||
@@ -11,0 +11,0 @@ "start": "node -r dotenv/config server.js", |
@@ -1,3 +0,3 @@ | ||
import app from './lib/app.js'; | ||
import pool from './lib/utils/pool.js'; | ||
const app = require('./lib/app.js'); | ||
const pool = require('./lib/utils/pool.js'); | ||
@@ -4,0 +4,0 @@ const PORT = process.env.PORT || 7890; |
@@ -1,4 +0,4 @@ | ||
import pool from './lib/utils/pool.js'; | ||
import setup from './data/setup.js'; | ||
const pool = require('./lib/utils/pool.js'); | ||
const setup = require('./data/setup.js'); | ||
setup(pool); |
{ | ||
"name": "@alchemycodelab/create-app", | ||
"version": "6.2.6", | ||
"description": "", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/alchemycodelab/create-app" | ||
}, | ||
"bin": { | ||
"create-app": "./index.js" | ||
}, | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"chalk": "^3.0.0", | ||
"commander": "^5.0.0", | ||
"inquirer": "^7.1.0", | ||
"mustache": "^4.0.1" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^7.19.0", | ||
"eslint-config-airbnb": "^18.2.1", | ||
"eslint-config-prettier": "^7.2.0" | ||
} | ||
"name": "@alchemycodelab/create-app", | ||
"version": "7.0.0", | ||
"description": "", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/alchemycodelab/create-app" | ||
}, | ||
"bin": { | ||
"create-app": "./index.js" | ||
}, | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"chalk": "^3.0.0", | ||
"commander": "^5.0.0", | ||
"inquirer": "^7.1.0", | ||
"mustache": "^4.0.1" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^7.19.0", | ||
"eslint-config-airbnb": "^18.2.1", | ||
"eslint-config-prettier": "^7.2.0" | ||
} | ||
} |
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
19168
40
1
14