Skip to content

Instantly share code, notes, and snippets.

View ozziest's full-sized avatar
🚀
Rock 'n' roll ain't noise pollution

Özgür Adem IŞIKLI ozziest

🚀
Rock 'n' roll ain't noise pollution
View GitHub Profile
$ curl \
-H "Content-Type: application/json" \
-X DELETE http://localhost:3000/api/users/1
@ozziest
ozziest / 6164ca0cc393-update-curl-request.sh
Created December 1, 2021 20:12
Update request by using curl
$ curl \
-d '{"name": "Karl", "surname":"Marx"}' \
-H "Content-Type: application/json" \
-X PUT http://localhost:3000/api/users/1
@ozziest
ozziest / 6164ca0cc393-fetching-result-by-id.json
Created December 1, 2021 20:11
Fetching result by id in Axe API project.
{
"id": 1,
"name": "Karl",
"surname": "Popper",
"created_at": 1638368500000,
"updated_at": 1638368500000
}
@ozziest
ozziest / 6164ca0cc393-axe-api-pagination-with-data.json
Created December 1, 2021 20:10
The pagination result with data.
{
"data": [
{
"id": 1,
"name": "Karl",
"surname": "Popper",
"created_at": 1638368500000,
"updated_at": 1638368500000
}
],
@ozziest
ozziest / 6164ca0cc393-creating-a-new-record-curl-request.sh
Created December 1, 2021 20:09
Creating a new record by using a curl request.
$ curl \
-d '{"name": "Karl", "surname":"Popper"}' \
-H "Content-Type: application/json" \
-X POST http://localhost:3000/api/users
@ozziest
ozziest / 6164ca0cc393-fillable-user-model.js
Created December 1, 2021 20:08
Basic user model with fillable field definitions.
class User extends Model {
get fillable() {
return ["name", "surname"];
}
}
@ozziest
ozziest / 6164ca0cc393-default-pagination-response.json
Created December 1, 2021 20:07
The default pagination response in an Axe API project.
{
"data": [],
"pagination": {
"total": 0,
"lastPage": 0,
"perPage": 1,
"currentPage": 1,
"from": 0,
"to": 0
}
@ozziest
ozziest / 6164ca0cc393-user-model.js
Created December 1, 2021 20:06
Basic User model in an Axe API project
import { Model } from "axe-api";
class User extends Model {}
export default User;
@ozziest
ozziest / 6164ca0cc393-executing-knex-migrations.sh
Created December 1, 2021 20:05
Executing knex.js migrations
$ knex --esm migrate:latest
@ozziest
ozziest / 6164ca0cc393-user-migration.js
Created December 1, 2021 20:04
The migration file of the "users" table.
export const up = function(knex) {
return knex.schema.createTable("users", function(table) {
table.increments();
table.string("name");
table.string("surname");
table.timestamps();
});
};
export const down = function(knex) {