The current setup has been tested on Next Js 7.0.0
.
You need to install Axios.
$ npm install axios
(function () { | |
"use strict"; | |
const MESSAGE_TYPE = { | |
SDP: 'SDP', | |
CANDIDATE: 'CANDIDATE', | |
} | |
let code; | |
let peerConnection; |
# ---- Base Node ---- | |
FROM mhart/alpine-node:10 AS base | |
# install node | |
RUN apk add --no-cache nodejs-current | |
# set working directory | |
WORKDIR /root/nextApp | |
# copy project file | |
COPY package.json . | |
COPY tsconfig.server.json . | |
COPY .npmrc . |
const express = require('express'); | |
const next = require('next'); | |
const sm = require('sitemap'); | |
const axios = require('axios'); | |
const port = parseInt(process.env.PORT, 10) || 3000; | |
const dev = process.env.NODE_ENV !== 'production'; | |
const app = next({ dev }); | |
const handle = app.getRequestHandler(); |
sudo rm -rf /Applications/Tuxera\ Disk\ Manager.app | |
sudo rm -rf /Library/Application\ Support/Tuxera\ NTFS | |
sudo rm -rf /Library/Filesystems/fusefs_txantfs.fs |
In this tutorial we're going to build a NodeJS website with the following features:
The first to parts of the tutorial are meant to quickly set you up and running. The third part is a more in depth explanation of some points I find important, so feel free to read them later as you need.
To connect Jetpack in your local installation, you'll need a way for WP.com servers to reach your server. That can be done in a number of different ways:
But these options fall short of ngrok
, which is a "localhost tunnel". It basically allows the Internet to hit a local port on your machine without worrying about ports or IPs.
As long as ngrok
is running, Jetpack / WP.com will be able to communicate with your local site. This will allow remote modules like Site Search and Manage to work.
/** | |
* Custom table sorting | |
*/ | |
import $ from 'jquery'; | |
export default { | |
// Set this opposite to what the default ordering is | |
DESC: false, |
import { ApolloClient, createNetworkInterface } from 'react-apollo' | |
import { SubscriptionClient, addGraphQLSubscriptions } from 'subscriptions-transport-ws' | |
const uri = 'http://localhost:4000/graphql' | |
const subscriptionsURI = 'ws://localhost:4000/' | |
let apolloClient = null | |
function _initClient (headers, initialState, subscriptionsInterface) { | |
return new ApolloClient({ | |
initialState, |
{ | |
"presets": [ | |
"react", | |
"stage-2", | |
[ | |
"env", | |
{ | |
"targets": { | |
"browsers": [ | |
"last 2 versions", |