// app/Playlist.php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Playlist extends Model
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const knex = require('knex'); | |
const app = express(); | |
const port = process.env.PORT || 8000; | |
app.get('/api/genres', function(request, response) { | |
let knex = connect(); | |
knex.select().from('genres').then((genres) => { | |
response.json(genres); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App; | |
use Illuminate\Database\Eloquent\Model; | |
class Genre extends Model | |
{ | |
protected $primaryKey = 'GenreId'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log('sup'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Component from '@glimmer/component'; | |
import { action } from '@ember/object'; | |
import { task } from 'ember-concurrency'; | |
import User from 'my-app/models/user'; | |
import Technology from 'my-app/models/technology'; | |
import TimeZone from 'my-app/models/time-zone'; | |
import { inject as service } from '@ember/service'; | |
import DS from 'ember-data'; | |
import ApplicationInstance from '@ember/application/instance'; |
When a client logs in, issue them a JWT with an expiration (more on this below). On subsequent API requests, send that token in an Authorization
header as a Bearer
token. This token can be stored in localStorage
, which is the most common, so that if the user revisits the site or refreshes the page, they are still logged in. Other client-side storage options like sessionStorage
or a cookie can be used. JWTs can get big though depending on how much information is stored in the payload, which could exceed the maximum cookie size (4K).
When an API call is made with an expired token, return a 401 HTTP status code and redirect users to the login page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Component from '@glimmer/component'; | |
export default class extends Component { | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Controller from '@ember/controller'; | |
import { inject as service } from '@ember/service'; | |
import { action } from '@ember/object'; | |
export default class ApplicationController extends Controller { | |
appName = 'Ember Twiddle'; | |
@service foo; | |
@action |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[redirects]] | |
from = "/*" | |
to = "/index.html" | |
status = 200 |