HTTP method | Service layer method | Real-time event |
---|---|---|
GET /features | features.find({}) | - |
GET /features?properties.type=building | features.find({ query: { properties.type: building } }) | - |
GET /features/id | features.get(id) | - |
POST /features | features.create(body) | features created |
PUT /features/id | features.update(id, body) | features updated |
PUT /features?properties.id=1 | features.update(null, body, { query: { properties.id: 1 } }) | features updated |
PATCH /features/id | features.patch(id, body) | features patched |
PATCH /features?properties.id=1 | features.patch(null, body, { query: { properties.id: 1 } }) | features patched |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
{ | |
"type": "Feature", | |
"resolution": 100, | |
"corridorWidth": 100, | |
"geometry": { | |
"type": "LineString", | |
"coordinates": [ | |
[x0,y0,z0], | |
..., | |
[xn,yn,zn] |
This file contains 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
[{ | |
"type": "Feature", | |
"properties": { | |
"state": "11, Aude, Occitanie", | |
"city": "Carcassonne", | |
"zipcode": "11000", | |
"citycode": "11069", | |
"countryCode": "FR", | |
"country": "France", | |
"type": "municipality", |
This file contains 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 feathers from '@feathersjs/client' | |
import { io } from 'socket.io-client' | |
export const client = feathers() | |
// Initialize as usual | |
const socket = io(origin) | |
client.configure(feathers.socketio(socket)) | |
export async function restoreSession () { | |
try { |
This file contains 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
module.exports = { | |
authentication: { | |
secret: 'your secret', | |
path: '/authentication', | |
service: '/users', | |
entity: 'user', | |
authStrategies: [ | |
'jwt', | |
'local' | |
], |
This file contains 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 _ from 'lodash' | |
import feathers from '@feathersjs/feathers' | |
import configuration from '@feathersjs/configuration' | |
import express from '@feathersjs/express' | |
import { AuthenticationService, JWTStrategy } from '@feathersjs/authentication' | |
import { LocalStrategy } from '@feathersjs/authentication-local' | |
import { AuthenticationProviderStrategy } from './AuthenticationProviderStrategy.js' | |
import { expressOauth } from '@feathersjs/authentication-oauth' | |
const app = express(feathers()) |
This file contains 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 _ from 'lodash' | |
import { OAuthStrategy } from '@feathersjs/authentication-oauth' | |
export class AuthenticationProviderStrategy extends OAuthStrategy { | |
async getEntityData (profile, entity) { | |
const createEntity = _.isNil(entity) | |
// Add provider Id | |
entity = { [`${this.name}Id`]: profile.id || profile.sub } | |
// When creating a new user extract required information from profile | |
if (createEntity) { |
This file contains 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
// Select the model to use and its hyperparameters | |
model = new Model(hyperparameters) | |
// Split available data into train and test datasets | |
x_train, y_train, x_test, y_test = split_data(x, y) | |
// Perform training | |
model.fit(x_train, y_train) | |
// Compute model performance over test dataset | |
model.compute_accuracy(x_test, y_test) | |
// Use model to predict new data | |
y = model.predict(x) |
NewerOlder