Skip to content

Commit

Permalink
add nodemon and config files for local dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Clinton Werth authored and Clinton Werth committed Jan 2, 2025
1 parent 684df60 commit ec1b62c
Show file tree
Hide file tree
Showing 6 changed files with 379 additions and 11 deletions.
9 changes: 9 additions & 0 deletions service/nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"execMap": {
"js": "ts-node --transpile-only",
"ts": "ts-node --transpile-only"
},
"watch": ["src/**/*"],
"ext": "ts,js",
"ignore": ["node_modules"]
}
136 changes: 131 additions & 5 deletions service/npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
"rfc5646": "^3.0.0",
"superagent": "^8.0.0",
"svg-captcha": "^1.4.0",
"ts-node": "^10.9.2",
"uniqid": "^5.2.0",
"walk": "2.3.4",
"winston": "1.0.1",
Expand Down
12 changes: 7 additions & 5 deletions service/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -641,10 +641,10 @@ async function initWebLayer(
}
}
try {
const webappPackagePath = require.resolve('@ngageoint/mage.web-app/package.json')
const webappPackagePath = require.resolve('../../web-app/package.json')
const webAppPath = path.dirname(webappPackagePath)
webController.use(express.static(path.join(webAppPath, 'app')))
webController.use('/admin', express.static(path.join(webAppPath, 'admin')))
webController.use(express.static(path.join(__dirname, '../../web-app/dist/app')))
webController.use('/admin', express.static(path.join(__dirname, '../../web-app/dist/admin')))
}
catch (err) {
console.warn('failed to load mage web app package', err)
Expand Down Expand Up @@ -705,12 +705,14 @@ declare module 'express' {
if (require.main === module) {
(async () => {
try {
const config = ;
console.log('Starting things...')
const config = JSON.parse(fs.readFileSync(path.resolve('./local_config.js'), 'utf-8'));;
const mageService = await boot(config);
mageService.open();
console.log('Local development server is running...');
} catch (err) {

console.log('error starting stuff', err);
process.exit(1)
}
})
}
2 changes: 1 addition & 1 deletion service/src/local_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module.exports = {
plugins: {
servicePlugins: [
'@ngageoint/mage.arcgis.service',
'@ngageoint/mage.image.service',
'../../plugins/image',
'@ngageoint/mage.nga-msi',
'@ngageoint/mage.random',
],
Expand Down
Loading

0 comments on commit ec1b62c

Please sign in to comment.