Skip to content

Commit

Permalink
JsDoc done YEAH, och det mesta funkar
Browse files Browse the repository at this point in the history
  • Loading branch information
jonerer committed Oct 25, 2024
1 parent 2b8fdf2 commit 6869acc
Show file tree
Hide file tree
Showing 191 changed files with 1,910 additions and 1,584 deletions.
3 changes: 3 additions & 0 deletions getting_started/.env
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
# In production you should probably set up your environment by more secure means

SESSION_KEY=example_key_change_me

DB_USER=postgres
DB_PASSWORD=starwars
7 changes: 5 additions & 2 deletions getting_started/app/controllers/HomeController.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { BaseController } from './BaseController'
import { BaseController } from './BaseController.js'
import { registerController } from 'semla'

class HomeController extends BaseController {
async home({ render }) {
return render('home.home')
const myContext = {
message: 'Hello world!',
}
return render('home.home', myContext)
}
}

Expand Down
4 changes: 3 additions & 1 deletion getting_started/app/views/home/home.tmp
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
Welcome to your new semla app!
Welcome to your new semla app!

{{l.message}}
9 changes: 7 additions & 2 deletions getting_started/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
require('@babel/register')({ extensions: ['.js', '.ts']})
const { start, setBasedir } = require('semla')
import { start, setBasedir } from 'semla'

import { fileURLToPath } from 'url'
import { dirname } from 'path'

const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)

setBasedir(__dirname)
start()
15 changes: 15 additions & 0 deletions getting_started/migrate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { runMigrations, setBasedir } from 'semla'

import { fileURLToPath } from 'url'
import { dirname } from 'path'

const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)

setBasedir(__dirname)

runMigrations()
/*
const semla = require('semla')
semla.runMigrationsCli()
*/
11 changes: 0 additions & 11 deletions getting_started/migrate.ts

This file was deleted.

8 changes: 4 additions & 4 deletions getting_started/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "MIT",
"scripts": {
"dev": "cross-env NODE_ENV=dev nodemon index.js",
"migrate": "node migrate.ts",
"migrate": "node migrate.js",
"test": "jest --runInBand",
"test-watch": "jest --watch --runInBand"
},
Expand All @@ -16,16 +16,16 @@
"@babel/register": "^7.11.0",
"axios": "^0.21.1",
"babel-jest": "^25.1.0",
"body-parser": "^1.19.0",
"body-parser": "^1.20.3",
"cross-env": "^7.0.2",
"moment": "^2.29.1"
},
"devDependencies": {
"prettier": "^1.19.1",
"@babel/cli": "^7.11.0",
"@babel/core": "^7.11.0",
"@types/node": "^14.14.20",
"jest": "^25.1.0",
"nodemon": "^2.0.2"
"nodemon": "^2.0.2",
"prettier": "^1.19.1"
}
}
Loading

0 comments on commit 6869acc

Please sign in to comment.