class App {
public app: Application
constructor () {
this.app = new Application()
this.middlewares()
this.database()
this.routes()
}
import app from './app'
const port = process.env.PORT || 3001
app.listen(port, () => console.log(`Server listening ${process.env.PORT}`));
getItem (KEY, defaultValue = null) {
let value
if (process.client) {
value = JSON.parse(localStorage.getItem(KEY))
return !value ? defaultValue : value
}
return null
},