mirror of
https://github.com/cupcakearmy/obolus.git
synced 2024-12-22 08:06:30 +00:00
dev environment
This commit is contained in:
parent
fe8a1c8412
commit
dd405d11ac
@ -1,11 +1,9 @@
|
||||
{
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"pkg": "tsc && pkg --targets latest-alpine-x64 --output ./server dist/server.js",
|
||||
"pkg:mac": "tsc && pkg --targets latest-macos-x64 --output ./server-macos dist/server.js",
|
||||
"prod": "NODE_ENV=production node dist/server.js",
|
||||
"build": "tsc",
|
||||
"dev": "npm i && tsnd --no-notify src/server.ts"
|
||||
"dev": "npm install --silent && tsnd --no-notify src/server.ts",
|
||||
"prod": "NODE_ENV=production node dist/server.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jsonwebtoken": "^8.3.2",
|
||||
|
@ -15,12 +15,6 @@ import router from './routes'
|
||||
createConnection({
|
||||
type: 'sqlite',
|
||||
database: join(process.cwd(), 'db.sqlite'),
|
||||
// type: "mysql",
|
||||
// host: "localhost",
|
||||
// port: 3306,
|
||||
// username: 'test',
|
||||
// password: 'test',
|
||||
// database: 'data',
|
||||
entities: [User, Purchase],
|
||||
synchronize: true,
|
||||
}).then(async () => {
|
||||
@ -31,7 +25,9 @@ createConnection({
|
||||
await User.createOrGet(user)
|
||||
}
|
||||
|
||||
const port = Config.get<number>('server.port')
|
||||
const port = process.env.NODE_ENV !== 'production'
|
||||
? 5000
|
||||
: 80
|
||||
const server = new Koa()
|
||||
|
||||
server.use(responseTime)
|
||||
|
8
package.json
Normal file
8
package.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev:local": "npm --prefix ./www run dev:local & npm --prefix ./api run dev",
|
||||
"dev:docker": "docker-compose up",
|
||||
"clean": "rm -r ./api/node_modules ./api/package-lock.json ./www/node_modules ./www/package-lock.json"
|
||||
}
|
||||
}
|
@ -1,12 +1,10 @@
|
||||
{
|
||||
"private": true,
|
||||
"assets": [
|
||||
".next/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"dev": "npm i && node server.js",
|
||||
"prod": "NODE_ENV=production node server.js",
|
||||
"build": "next build"
|
||||
"build": "next build",
|
||||
"dev": "npm install --silent && node server.js",
|
||||
"dev:local": "npm install --silent && API_HOST=localhost node server.js",
|
||||
"prod": "NODE_ENV=production node server.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^0.18.0",
|
||||
|
@ -12,7 +12,9 @@ const app = next({ dev })
|
||||
const handle = app.getRequestHandler()
|
||||
|
||||
const proxy = httpProxy.createProxyServer()
|
||||
const target = 'http://api'
|
||||
const target = dev
|
||||
? `http://${process.env.API_HOST || 'api'}:5000`
|
||||
: 'http://api'
|
||||
|
||||
app.prepare().then(() => {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user